CSS3 PIE Forums

Page 1 of 1

Author:  bmoshe [ Mon Jan 31, 2011 8:54 am ]
Post subject:  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,

Author:  jason [ Mon Jan 31, 2011 10:08 am ]
Post subject:  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?

Author:  jason [ Mon Jan 31, 2011 11:00 pm ]
Post subject:  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.

Author:  marcus1060 [ Thu Feb 03, 2011 6:22 pm ]
Post subject:  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.

Author:  jason [ Thu Feb 03, 2011 7:41 pm ]
Post subject:  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.

Author:  marcus1060 [ Fri Feb 04, 2011 2:24 am ]
Post subject:  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.

Author:  jason [ Mon Feb 21, 2011 8:47 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group