Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Component for timing execution of js and others

NEW
Assigned to

Status

()

Core
XPCOM
9 years ago
8 years ago

People

(Reporter: (dormant account), Assigned: (dormant account))

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 5 obsolete attachments)

Comment hidden (empty)
(Assignee)

Comment 1

9 years ago
Created attachment 353562 [details] [diff] [review]
timing component

This registers early on and starts timing js calls..Any call slower than 1ms is flagged. 
Calls are printed out to console in a "stack" form. This is achieved with a counter(gMeasureDepth) which tracks nesting level(not thread safe). Any suggestions would be appreciated.
Sample output:
496ms     CallHook (anonymous) chrome://browser/content/WidgetStack.js:1177 1.1ms
500ms     CallHook (anonymous) chrome://browser/content/WidgetStack.js:1177 1.3ms
500ms      CallHook (anonymous) chrome://browser/content/WidgetStack.js:1281 1.3ms
500ms     CallHook (anonymous) chrome://browser/content/WidgetStack.js:1177 1.6ms
500ms    CallHook (anonymous) chrome://browser/content/WidgetStack.js:308 6.2ms
500ms   CallHook WidgetStack chrome://browser/content/WidgetStack.js:255 6.2ms
Assignee: nobody → tglek
(Assignee)

Comment 2

9 years ago
Created attachment 353565 [details] [diff] [review]
timing component

missed a file
Attachment #353562 - Attachment is obsolete: true
(In reply to comment #1)
> Created an attachment (id=353562) [details]
> timing component
> 
> This registers early on and starts timing js calls..Any call slower than 1ms is
> flagged. 
> Calls are printed out to console in a "stack" form. This is achieved with a
> counter(gMeasureDepth) which tracks nesting level(not thread safe). Any
> suggestions would be appreciated.

Is it possible to just walk the JS stack frames up to the root and count them to compute the stack depth?  I know you can do this from JS so I assume it's possible from C++ as well.  This will be a little bit slower, but it ought to be threadsafe.  Just a thought.
(Assignee)

Comment 4

9 years ago
i'd rather use tls or something for the counter, since it's handy to be able to place these into C++ code and see when they are called from js
(Assignee)

Updated

9 years ago
Blocks: 459117
(Assignee)

Comment 5

9 years ago
Created attachment 355626 [details] [diff] [review]
timing componentb

This version should work pretty well. It still doesn't do TLS, but I haven't had to time stuff across threads yet, so it's ok.
To use set MOZ_STOPWATCH environment variable, when it's not set the component doesn't do anything.
Attachment #353565 - Attachment is obsolete: true
(Assignee)

Comment 6

9 years ago
Created attachment 358203 [details] [diff] [review]
timing component(using tls)
Attachment #355626 - Attachment is obsolete: true
(Assignee)

Comment 7

9 years ago
Created attachment 358204 [details] [diff] [review]
I found these probes to be useful...esp EndPageLoad
(Assignee)

Comment 8

9 years ago
Created attachment 358206 [details] [diff] [review]
spidermonkey...tell jsd when a a fastcall is being executed

This is a little bit of a hack. It enables the timing component to be notified when a fastcall is run. This is useful when there is dom code(which often uses fastcalls) where a dom method is taking up most of the time, but it's unclear which. This made solving the resize issue much easier.
(Assignee)

Comment 9

9 years ago
Created attachment 358261 [details] [diff] [review]
script to sum up execution times...for quick log analysis

This is another convenience, to use it get a log for something you want to analyze fennec js overhead in, then run the script. This does a frequency count and duration of js function calls.
(Assignee)

Comment 10

8 years ago
Created attachment 390036 [details] [diff] [review]
latest component diff

This one logs to per-thread files
Attachment #358203 - Attachment is obsolete: true
(Assignee)

Comment 11

8 years ago
Created attachment 404348 [details] [diff] [review]
latest component diff
Attachment #390036 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.