Find out which features are CPU intensive

I use jQuery a lot, especially for animations like fading or gliding :)

so I add various functions that do this on elements like

$(".fade").each(function(....)

or

$('*[class*="slide-"]').each(function(...)...

In some elements, I use livequery without specifying an event (so that it detects new elements being added to the DOM).

$('*[class*="slide-"]').livequery(function(...

This uses a lot of CPU.

In any case, I ask if there is an application or something like a code profiler that can show me how much the CPU uses each of these functions that are connected to selectors / events.

+6
javascript jquery dom html
source share
5 answers

WebKit-based browsers (such as Chrome) have a processor profiling tab in the developer tools, maybe this is what you are looking for.

+2
source share

Use the developer tools in Chrome and Safari or Firebug for Firefox and check out the Profiles section. In IE8, press F12 to open your own developer tools and profiling. This question has also been asked, answered, and accepted already on stackoverflow.

+5
source share

Firebug in Firefox has a wonderful profile tab that shows startup scripts and runtimes (if that's what you're looking for)

+3
source share

As already mentioned, many modern browsers include profilers. You can also check out the jQuery Profile plugin to complement these profilers ...

http://plugins.jquery.com/project/profile

+2
source share

The new IE9 Developer Toolbar has a good profiler.

+1
source share

All Articles