Reusing "$.mobile.firstPage" variable to improve performance slightly. #5402

merged 1 commit into from Dec 24, 2012


None yet
2 participants

Changsuk commented Dec 24, 2012

"$page.first()" function call is repeated on file. "$page.first()" function is already called and assigned to "$.mobile.firstPage" variable. So the variable should be used without duplicated function call. You can know that Javascript Core(JSC) or another Javascript runtime engine will execute $page.first() function once more at that line. So It would be better to use not "$page.first()." but "$.mobile.firstPage."
And there are verified PR steps.

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

My team is developing Tizen web UIFW and got a few performance issues. I told Mr, Todd and he ask me to upload it. So I choose a very simple case because this is my first PR. It's the first for me to submit a PR. If there are any problems or mistakes to review it, please let me know. Thanks in advance. Merry Christmas~!! :)


gseguin commented Dec 24, 2012

Thanks! Merry Christmas!

gseguin added a commit that referenced this pull request Dec 24, 2012

Merge pull request #5402 from Changsuk/master
Reusing "$.mobile.firstPage" variable to improve performance slightly.

@gseguin gseguin merged commit e5e50d2 into jquery:master Dec 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment