mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
InternPool: avoid indexToKey recursion for ptr_slice
Recursion makes this hot function more difficult to profile and optimize. The ptr_slice encoding now additionally includes the slice type. This makes typeOf() implementable without indexToKey() as well as no longer using recursion in the ptr_slice prong of indexToKey itself. Unfortunately some logic had to be duplicated. However, I think that a future enhancement could eliminate the duplication as well as remove some other unwanted code, improving performance, by representing a slice value in `Key.Ptr` without `addr` populated directly, but with an `Index` pointing to the underlying manyptr value.
This commit is contained in:
parent
f7177fb821
commit
55cda9a592
1 changed files with 82 additions and 18 deletions
Loading…
Add table
Add a link
Reference in a new issue