fxprof-processed-profile

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.

Description

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.

About the format

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:

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).