TL;DR it turns out chrome://tracing has a structured label format, we where accidentally using. This should make us use it for out labels, it isn't perfect but its better then it was. It appears this is likely as good as it will get without changes in chrome://tracing itself.
As a bonus, @krisselden pointed out we can use PerformanceOberserver to defer the measure costs, until we are done running user code. This reduces the overhead dramatically, what remains are the mandatory "mark" calls, which we can't do much about.
TL;DR it turns out chrome://tracing has a structured label format, we where accidentally using. This should make us use it for out labels, it isn't perfect but its better then it was. It appears this is likely as good as it will get without changes in chrome://tracing itself.
As a bonus, @krisselden pointed out we can use PerformanceOberserver to defer the measure costs, until we are done running user code. This reduces the overhead dramatically, what remains are the mandatory "mark" calls, which we can't do much about.
before:
after: