jquery/jquery-mobile — pull request #5786 by stforek (2013-03-19 13:39:03+00:00)
Title: Cache page object

Hi. I found that method $.mobile.widget.prototype.enhance calls $.mobile.closestPageData() function every time widget has useKeepNative = true.
This $.mobile.closestPageData() is looking for page widget in which current widget is created. In most cases $.mobile.widget.prototype.enhance is called from $.mobile.widget.prototype.enhanceWithin where target is current page, the same we are looking for in enhance method.
I added internal param to enhance method which allows to use cached earlier page object.

There are a lot of widgets with useKeepNative=true and on mobile devices it gives about 40ms of performance boost on average page.