aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-05-29 17:18:23 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:56 -0700
commitf7177fb8215714f9f22e3f9da0d3c7d3ad58d390 (patch)
tree21b113788cf614164b11a3f3968543e352080be0 /src/value.zig
parentf2778f7ca07cdfd599c65185dbcc6a648740fd5d (diff)
downloadzig-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