Open Bug 1496325 Opened 7 years ago Updated 10 months ago

[exploration] Investigate telemetry to track wasm machine code / byte code ratios for buffer presizing

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

Tracking

()

People

(Reporter: lth, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

At the moment, we use factors that were computed once from a small corpus of code to estimate the size of the machine code buffer from a combination of platform, compiler, and code section size; this works well because we found a fairly strong correlation. Over time, as new compilers generate code for wasm from new languages, we should expect this correlation to change, and the factors - if they are still meaningful - may also change. We really should attempt to have some visibility to this. Telemetry may be the answer. We would want to log, per wasm module, either several raw data points (bytecode size, code section size, object code size, compiler, architecture) or, for less leaky but also less informative data, ratios of object code size to bytecode size and code section size, along with the other data, and perhaps the ratios of those ratios to the constants we use. Then we could adjust the constants. (Another possibility is for the browser to adapt to the content the user is loading by refining these factors over time and storing them in the profile; this reduces telemetry but also tells us less about what the starting factors should be; a good initial guess is worth something, and we'd still want a way to make that.)
That's a good idea. A quantized (into one of, say, 100 buckets, to avoid too much PII) ratio seems simple and effective and could also give an indication of how much variance we have. For that matter, telemetry on quantized: bytecode size and whether tiering and/or streaming was used could be really useful.

(Memo to self, bug 1518077 can serve as a template.)

Prototype / WIP reporting code, rescued from bug 1442540.

Chris, I think this is related to what you were talking about for CL yesterday.

Flags: needinfo?(cfallin)

Thanks! This was helpful as a starting point. I created bug 1656638 to track the effort to get telemetry for compile and run times for Wasm code.

Flags: needinfo?(cfallin)
Type: enhancement → task
Summary: Investigate telemetry to track wasm machine code / byte code ratios for buffer presizing → [exploration] Investigate telemetry to track wasm machine code / byte code ratios for buffer presizing
Severity: normal → S3
Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: