Crates.io | fxprof-processed-profile |
lib.rs | fxprof-processed-profile |
version | 0.7.0 |
source | src |
created_at | 2022-05-08 15:01:56.885444 |
updated_at | 2024-04-15 21:58:38.963424 |
description | Create profiles in the Firefox Profiler's processed profile JSON format. |
homepage | |
repository | https://github.com/mstange/samply/ |
max_upload_size | |
id | 582565 |
size | 173,588 |
A crate that allows creating profiles in the Firefox Profiler's "Processed profile" format.
Still work in progress, under-documented, and will have breaking changes frequently.
This crate is a sibling crate to the gecko_profile
crate.
Profiles produced with this crate can be more efficient because they allow the Firefox Profiler to skip a processing step during loading, and because this format supports a "weight" column in the sample table. The sample weight can be used to collapse duplicate consecutive samples into one sample, which means that the individual sample timestamps don't have to be serialized into the JSON. This can save a ton of space.
When the Firefox Profiler is used with Firefox, the Firefox Profiler receives profile data in the "Gecko profile" format. Then it converts it into the "processed profile" format.
The "processed profile" format is the format in which the files are stored when you upload the profile for sharing, or when you download it as a file. It is different from the "Gecko profile" format in the following ways:
[stack_index, time, eventDelay, cpuDelta]
. The struct-of-arrays form makes the data cheaper to access and is much easier on the browser's GC.funcTable
, a resourceTable
and a nativeSymbols
table. These tables do not exist in the "Gecko profile" format.frameTable
is different. For example, each frame from the native stack has an integer code address, relative to the library that contains this address. In the "Gecko profile" format, the code address is stored in absolute form (process virtual memory address) as a hex string.The "processed profile" format is almost identical to the JavaScript object structure which the Firefox Profiler keeps in memory; the only difference being the use of stringArray
(which is a plain JSON array of strings) instead of stringTable
(which is an object containing both the array and a map for fast string-to-index lookup).