]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #75452 - michaelwoerister:sp-cache-more-query-keys, r=lcnr
authorTyler Mandry <tmandry@gmail.com>
Fri, 14 Aug 2020 01:00:11 +0000 (18:00 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Aug 2020 01:00:11 +0000 (18:00 -0700)
commit6f964f0a077c1eed1ee51f46cbb506341e4407b4
tree5d781654cb9549e311101fa57b0ab8dc1668742c
parent1f73e898ee1da743bf9b27e529e070424ca25acf
parent08d951768f6f9b98ca5ffe3385adfb3f1935af22
Rollup merge of #75452 - michaelwoerister:sp-cache-more-query-keys, r=lcnr

self-profile: Cache more query key strings when doing self-profiling.

This PR adds optimized `SpecIntoSelfProfilingString` implementations for two common query key types (`LocalDefId` and `WithOptConstParam`). This makes raw self-profiling data on disk 8-9% smaller for my two test cases (`regex` and `cargo`).

The on-disk format is not affected, so no tooling updates need to happen.

I also tried adding an impl for `Ty<'tcx>` (which should reduce size quite a bit) but the compiler did not allow me to add a specialized impl parameterized with `'tcx`. I don't know if there is an actual problem with that or if the implementation of specialization just doesn't support it yet.

cc @wesleywiser @Mark-Simulacrum