Forums
View unanswered posts | View active topics It is currently Mon Nov 24, 2014 6:19 am



Reply to topic  [ 7 posts ] 
 Optimizations!!! 
Author Message

Joined: Mon Jan 31, 2011 8:35 am
Posts: 1
Post Optimizations!!!
Hey guys,

I tried using PIE in http://www.lushee.com/en/Jokes/ and it was way too slow (~8 seconds of loading).
The -pie-lazy-init:true; did not help at all.

I took a look at the code itself, and I noticed several things that can be easily optimized:
1. Usage of new Date() and Math.Random() instead of calculating the date as a global constant and using a global counter instead of a random number. A slight difference in performance was noticed.
2. Arrays and primitives created locally can be used as global variables, and if arrays are needed to be recreated at a function level, then use them as global stacks (then, by setting the global index to 0, you reset the array). I began doing that and it made a significant improvement in performance.

I can do the conversion myself, but I need to have a list of all functions, sorted by priority (the number of times each function is running in a page like Lushee Jokes).

Best Regards,
Moshe
http://www.lushee.com/


Mon Jan 31, 2011 8:54 am
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1446
Post Re: Optimizations!!!
Thanks for these suggestions. #1 I had actually already done on a local branch, but it needs to be pushed to GitHub. #2 is something I had not considered and am very interested in seeing numbers on. Can you send me the work you have done so far?


Mon Jan 31, 2011 10:08 am
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1446
Post Re: Optimizations!!!
Also I'm very surprised that -pie-lazy-init didn't help in your case. On your site that should have reduced the initial render to under a dozen elements, which should happen in an almost unnoticeable time. You wouldn't see the performance hit until scrolling down the page; can you verify that's the case? If not then that indicates a bug in the lazy init.


Mon Jan 31, 2011 11:00 pm
Profile

Joined: Sat Jan 08, 2011 3:58 am
Posts: 3
Post Re: Optimizations!!!
I'm also getting similar delays in loading (at least 7 seconds with IE7) with lazy init, on or off. Using lazy-init I've also notice while scrolling the page sometimes IE locks up for a few seconds and won't scroll or anything.

Just thought I'd let you know it's happening to me too.


Thu Feb 03, 2011 6:22 pm
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1446
Post Re: Optimizations!!!
@marcus1060: are you like bmoshe using in on hundreds of elements? If so I'm not surprised there's a big delay, but I want to make sure there isn't something going wrong on a smaller set of elements. In either case if you would be able to package up your page's code so I can use it as a performance testcase that would be very helpful, it's good to have real-world cases for profiling.


Thu Feb 03, 2011 7:41 pm
Profile

Joined: Sat Jan 08, 2011 3:58 am
Posts: 3
Post Re: Optimizations!!!
There really isn't that many elements using it, less than 50 (in fact my quick, rough count only came up with 20 on a particular page), though the page it's self is pretty large, and does contain a good amount of elements.
I'll try an get the code to you within the next few days to benchmark.


Fri Feb 04, 2011 2:24 am
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1446
Post Re: Optimizations!!!
@bmoshe: are you able to send the work you've done so far on those optimizations, or at least an example of the kind of thing you're talking about? If it truly does give a significant improvement then I'd love to get this integrated.


Mon Feb 21, 2011 8:47 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.