Firebug 1.05 Profiling Bug
I just reported this little nugget to the Firebug bug report. Basically, the problem I ran into was in trying to do some profiling using Firebug to see where my code bottlenecks were occuring. Little did I realize that I was being led astray.
If you're not familiar with using the profile feature, you should be. It's a handy way to see how much time is getting spent in each function. (Maybe I'll do a post about using this handy little feature in the future...)
Anyways, here's the bug I ran into:
console.profile('test');
var a= {b:function(){},c:function (){}};
a.c();
console.profileEnd();
The console.profile and profileEnd calls are part of the Firebug panel and will start and stop the profiler respectively.
What you should get from this is a report of time spent in the c() function. Instead, you'll be told that time was spent in the b() function, since it's the first function declared in the object literal.
You're most likely to run into this problem profiling compressed code which would happen if you, say, were using the compressed version of a particular JavaScript library. Obviously, my advice is to use uncompressed code, even for popular JavaScript libraries.
Conversation
I definitely think you should write a post about the profile feature.
Yes that would be appreciated
If not here, then somewhere else... ;)
Agreed. A podcast would be even better :)
The profiler is so sweet. It saved my butt and helped me shave 4-6 seconds off of a front page's load time by identifying a hog of a function that occupied 80% of the overall render time.