Stop eagerly allocating profile strings
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fix-optional |
People
(Reporter: jandem, Unassigned)
References
(Depends on 1 open bug)
Details
We currently allocate these strings here:
https://searchfox.org/mozilla-central/rev/7944190ad1668a94223b950a19f1fffe8662d6b8/js/src/vm/GeckoProfiler.cpp#155
https://searchfox.org/mozilla-central/rev/7944190ad1668a94223b950a19f1fffe8662d6b8/js/src/jit/JitcodeMap.cpp#280
The strings then end up in the JitCodeMap or in the interpreter's profiler pseudo stack. The sampler thread gets the strings from there and copies them into the profiler's buffer (multiple entries with up to 8 chars). This isn't very efficient.
For the interpreter work I need a different approach. I'm considering something like this:
-
Sampler thread stores the JSScript* and bytecode offset in the buffer.
-
When we GC or finish profiling (whichever comes first) the main thread iterates this buffer and replaces all JSScript* pointers with the corresponding script string. GC could also trace the scripts but then we risk keeping them alive much longer when profiling, skewing the results.
| Reporter | ||
Comment 1•7 years ago
|
||
Hey Markus, any thoughts/pointers on this?
Comment 2•7 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1)
Hey Markus, any thoughts/pointers on this?
Answered on the email thread about this. The rough plan in comment 0 sounds good.
Updated•7 years ago
|
Updated•3 years ago
|
Description
•