After completing some code and pushing it into production, I checked the performance my browsers' profiler tools, e.g. using Firebug > console > Profile ; and, suing Chrome > Developer Tools > Profiles.
I'm looking at the code on my global object / namespace (BOL); specifically, constructors and methods with large max time or high volume of calls to be sure that the code appears to perform efficiently, e.g. are the % numbers and ave. times are low. Also, I am wondering about how efficiently I'm using a library or abusing it (jQuery); so, I'm checking to see if the methods with the most calls don't have high max times. For example : Firebug > Console > Profile using code at : http://www.karenkane.com/about-karen/company-history/ (Function, Calls, Percent, Own Time, Time, Avg, Min, Max, File) css, 1364, 38.29%, 172.815ms, 212.664ms, 0.156ms, 0.005ms, 0.422ms, jquery.min.js (line 116) show, 1317, 3.05%, 13.767ms, 381.385ms, 0.29ms, 0.021ms, 6.407ms, jquery.min.js (line 142) The show method average is twice that of css, which leads me to think that I should be modifying css classes more often to set a class that will show/hide instead of using the jQuery show method. Another example : same code: http://www.karenkane.com/about-karen/company-history/ Chrome > Developer Tools > Profiles > Head Snapshot (Constructor, Count, Size) BOL.CollectionCarousel, 1, 52B String, 15988, 367.22KB (code), 5052, 1.19MB (closure), 3815, 906.37KB Object, 1513, 166.69KB The size of 52B (for BOL.CollectionCarousel) seems relatively minimal; but I find the statistic for (code) at the size of 1.19MB to be large. So here are my questions... 1. What specifics do you usually watch when profiling in a browser tool ? 2. Do you see any stats in the profiler for http://www.karenkane.com/about-karen/company-history/ that I missed or should be alarmed by ? 3. Would I get better results/indications of performance by profiling with more specific tools using a library like YUI 2: Profiler ? [ links / references : http://getfirebug.com/javascript - Profile JavaScript performance ; http://developer.yahoo.com/yui/profiler/ - Getting Started ; http://code.google.com/chrome/devtools/docs/heap-profiling.html - Summary view ] -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
