Closed Bug 1918118 Opened 1 year ago Closed 1 year ago

Reduce the number of times we parse Glean definitions yamls in tree

Categories

(Toolkit :: Telemetry, enhancement, P4)

enhancement

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox-esr128 --- fixed
firefox132 --- fixed

People

(Reporter: chutten, Assigned: sergesanspaille)

References

Details

Attachments

(2 files, 5 obsolete files)

In bug 1686265, Nika showed us how to get down to just two GeneratedFile directives in t/c/g/moz.build. Things have complicated somewhat in the two years since, and now we parse the same or similar sets of files many times a build (plus one more if it's artifact).

In the ideal case we shouldn't need to parse a given metrics.yaml, pings.yaml, or tags.yaml file more than once: we could parse the whole lot and then pass the subset of the object trees to the necessary code generators. Even following the existing pattern, there are only three unique sets of yamls in use (metrics+tags, pings+tags, metrics+pings+tags) suggesting any number of parses above three is likely especially unnecessary. (And for artifact builds (or any build without a compiler, honestly), we probably don't want to generate a bunch of compiled code that'll never be compiled.)

This bug is about reducing the number of times we call glean_parser. (For the bug reducing the amount of rebuilding necessary as a result of a change to a given yaml file, see bug 1879329.) Be sure to run any changes against a variety of build configurations on try because who knows, maybe there's a config that runs without a compiler but expects codegen to happen anyway so they can pass it on to a compile task later? <shrug emoji>

It looks possible to cache the parsing of the yaml files parsing so that further invocation can just absorb the internal representation. i'll investigate if that's an easy win.

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Assignee: nobody → sguelton
Status: NEW → ASSIGNED
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/085ebfdd51c9 Cache parsing of glean metrics r=chutten,TravisLong
Blocks: 1918980
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
Regressions: 1919118

Comment on attachment 9424372 [details]
Bug 1918118 - Cache parsing of glean metrics r=glandium

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Needed for Thunderbird Glean - bug 1954442.
    Other needed patches relies on this bug.
  • User impact if declined:
  • Fix Landed on Version: 132
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It's build level improvement
Attachment #9424372 - Flags: approval-mozilla-esr128?
See Also: → 1954442

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474095 - Flags: approval-mozilla-esr128?
Attachment #9474095 - Attachment is obsolete: true
Attachment #9474095 - Flags: approval-mozilla-esr128?

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474110 - Flags: approval-mozilla-esr128?

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474122 - Flags: approval-mozilla-esr128?

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474306 - Flags: approval-mozilla-esr128?

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474315 - Flags: approval-mozilla-esr128?

Glean metrics are described in yaml, which is notably slow to parse.
Instead of repeatedly parsing the same metrics again and again, cache
the parsing result.

Original Revision: https://phabricator.services.mozilla.com/D221944

Attachment #9474353 - Flags: approval-mozilla-esr128?
Attachment #9474353 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
Attachment #9474306 - Attachment is obsolete: true
Attachment #9474306 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128-
Attachment #9474315 - Attachment is obsolete: true
Attachment #9474315 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128-
Attachment #9474110 - Attachment is obsolete: true
Attachment #9474110 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128-
Attachment #9474122 - Attachment is obsolete: true
Attachment #9474122 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128-
Attachment #9424372 - Flags: approval-mozilla-esr128?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: