diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-29 17:18:23 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:56 -0700 |
| commit | f7177fb8215714f9f22e3f9da0d3c7d3ad58d390 (patch) | |
| tree | 21b113788cf614164b11a3f3968543e352080be0 /src/value.zig | |
| parent | f2778f7ca07cdfd599c65185dbcc6a648740fd5d (diff) | |
| download | zig-f7177fb8215714f9f22e3f9da0d3c7d3ad58d390.tar.gz zig-f7177fb8215714f9f22e3f9da0d3c7d3ad58d390.zip | |
InternPool: avoid indexToKey recursion for opt_payload
This is a hot function, and recursion makes it more difficult to
profile, as well as likely making it more difficult to optimize.
Previously, indexToKey for opt_payload would call getAssumeExists() on
the optional type. This made it possible to omit the optional type in
the encoding of opt_payload. However, getAssumeExists() *must* call
indexToKey because of hashing/equality.
So, this commit adds the optional type to the opt_payload encoding,
which increases its "extra" size from 0 to 8 bytes. As a result,
the opt_payload encoding went from not showing up on the top 25 largest
tags to...still not showing up in the top 25 largest tags.
This also helps make InternPool.typeOf() no longer need to call
indexToKey which is another hot function and another source of
recursion.
Diffstat (limited to 'src/value.zig')
0 files changed, 0 insertions, 0 deletions
