the profiler in firebug needs to attach some functions to the js
engine in the browser, which inevitably introduces overhead. so if you
use profiler, the total time is not that useful, because that includes
the overhead, especially if the code you are profiling calls some
functions lots of times (>1000) (it seems to me the overhead the
profiler introduces is proportional to how many times functions are
invoked)

instead, I'd suggest only look at the relative time in the profile
report between different functions to identify bottlenecks in your
code so you know where to optimize.

if you are only interested in the raw performance (how fast a portion
of your code runs), then console.time is a better solution: it
introduces little overhead, so the measurement is quite accurate.

the above is to my best knowledge, but I may be wrong.


On Thu, Sep 3, 2009 at 11:02, kyuho<[email protected]> wrote:
>
> Thank you for your reply,
>
> I do realize they are two different measuring method.
> I still think, maybe I am wrong, given the same code and same
> recording place the
> total measured time should be the same shouldn't it?
> At times I get really close results from time and profile method and
> at other times I don't.
> So I guess what I am wondering is why are the result the same only
> sometimes.
> I would be more understanding if I see time > profile all the time but
> that is not the case.
> I am sorry if I am being pesky but I want to know in what situation
> this could be the same,
> and under what situation they are different.
>
> Thank you
>
>
> On Sep 2, 7:22 pm, johnjbarton <[email protected]> wrote:
>> On Sep 2, 2:32 pm, kyuho <[email protected]> wrote:
>>
>> > Hello,
>>
>> > I am testing javascripts in my application and decided to use firebug
>> > to test performance.
>> > however I noticed sometimes the time i get fromconsole.timeand
>> >console.profileis different.
>> > Could anyone tell me a possible reason for this.
>>
>> The implementation of these two measurements is completely 
>> different.console.timecalls Date() and gives you the delta when you call 
>> timeEnd
>> ().console.profilecalls the Javascript profiler.  So I would guess
>> thatconsole.time>console.profileand the delta can be arbitrarily
>> large.
>>
>> jjb
>>
>>
>>
>> > thank you,
>> > kyuho
> >
>



-- 
Frontend Lead, teampatent.com
生于忧患,死于安乐
"People's characters are strengthened through struggle against
difficulties; they are weakened by comfort."
- Old Chinese adage

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to