jquery/jquery-mobile — pull request #5404 by Changsuk (2012-12-28 08:04:15+00:00)
Title: Reducing $(document) and $(window) functions call count to improve performance.

This case is similar with #5402. My team is developing Tizen web UIFW and got a few performance issues and this PR is first case to improve performance. "$( document )" and "$( window )" functions are repeatly called 73 times on many *.js files and the size of $() function is not small too. So I thought that it would be better to cut down and fix the function call count in performance view.

To resolve the issue my team created two variables to store the return values of the functions and changed the function calls to the variables - $.mobile.$window and $.mobile.$document. Therefore the functions are just called 2 times. After my team tested it on PC and Mobile devices, we got a performance improvement.

To be used in the other funtions the variables are defined in jQuery.mobile on my code. If the variables should be moved to another function, please let me know it.

- Tests : The code has been tested on several jQM widgets using qunit.js.
- Modified code is followed the jQuery Core Style guide.
- Scope : Performance improvement.

It is a simple case and similar with #5402. But my team modified many files to cover the issue but the method is very simple. We just change the function calls to using the new variables. If there are any problems or mistakes on my PR, please let me know. Thanks in advance. Happy New Year~!! :)