Open Bug 848071 Opened 12 years ago Updated 3 years ago

Optimize circular buffer usage of JS frames

Categories

(Core :: Gecko Profiler, task, P3)

x86
macOS
task

Tracking

()

People

(Reporter: BenWa, Unassigned)

References

(Blocks 3 open bugs)

Details

The profiler uses a circular buffer to store samples. It copies the JS frames into the circular buffer which consumes a disproportionate amount of space compared to c++ frames. On low memory b2g devices we reduce the circular buffer for memory constraint meaning the JS frames wrap the circular buffer very quickly.
I think the best option is to modify the lifetime of JS labels such that they don't need to be copied for every sample. Perhaps allow the profiler to AddRef the JS labels it currently has in it's circular buffer. This isn't simple because the AddRef/ReleaseRef needs to be perform from a signal handler
Blocks: 758697
Blocks: 1047646
Blocks: 1145297
Blocks: 1330576

Benoit, do you know if this old bug is still valid? (If you don't have the time to check, please just cancel the NI.) TIA.

Flags: needinfo?(b56girard)

It is still valid, but it's unknown how much impact it has / how much skew it causes.

Basically, for JIT frames, we only store an address in the buffer. But interpreter frames use profiler label frames, which store the entire function string in the buffer. That's the whole function name and the URL. It is possible that this causes skew, attributing too much time to interpreted JS, see bug 1330576.

Flags: needinfo?(b56girard)
Severity: normal → N/A
Type: defect → task
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.