The Little Guy Posted July 26, 2012 Share Posted July 26, 2012 I have been building a home page, and I have a script that fades images out for a slide show. for testing purposes, I made two scripts, one uses jQueries fadeOut() function an another is a jQuery plugin I made without the use of fadeOut(). While testing, I opened chrome's "background pages" tool, and watched the site. Whenever jQuery's fadeOut() function was triggered, the cpu went up to about 50%. When I tested my plugin the cpu only went up to 32%. jQuery's: ciaobellaphotography.us My jQuery plugin: ciaobellaphotography.us/index2.php Do you guys see any noticeable difference between the two or have any additional thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/266308-jquery-fadeout-too-much-cpu/ Share on other sites More sharing options...
Philip Posted July 26, 2012 Share Posted July 26, 2012 I see 1/2 the CPU usage on index2 with 2x the framerate. Quote Link to comment https://forums.phpfreaks.com/topic/266308-jquery-fadeout-too-much-cpu/#findComment-1364735 Share on other sites More sharing options...
The Little Guy Posted July 26, 2012 Author Share Posted July 26, 2012 Sorry for this stupid question, but when you say 2x framerate do you mean 2x faster or 2x slower? Quote Link to comment https://forums.phpfreaks.com/topic/266308-jquery-fadeout-too-much-cpu/#findComment-1364746 Share on other sites More sharing options...
The Little Guy Posted July 26, 2012 Author Share Posted July 26, 2012 Update: I just changed the formula on index2's plugin Quote Link to comment https://forums.phpfreaks.com/topic/266308-jquery-fadeout-too-much-cpu/#findComment-1364752 Share on other sites More sharing options...
scootstah Posted July 27, 2012 Share Posted July 27, 2012 ciaobellaphotography.us - memory is around ~78,000-83,000K, CPU peaks at about 24% briefly, Javascript memory is ~13,000K ciaobellaphotography.us/index2.php - memory is around ~46,000-58,000K - CPU peaks at 18-20% briefly, Javascript memory is ~8,000K So, it looks like index2.php performs a tiny bit better. As far as unresponsiveness or any visual lag, I don't notice any between the two on my machine. Quote Link to comment https://forums.phpfreaks.com/topic/266308-jquery-fadeout-too-much-cpu/#findComment-1364768 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.