Use constexpr arrays for metadata about IL instruction operands - #7758
Conversation
|
In general I'm a huge fan of this PR. I appreciate all the static asserts which should help this code from breaking in the future. I don't see downsides to any of this. This seems like it should shave off some bytes on every IL instruction allocation which is a nice win too. I was trying to see if anything could be made consteval to provide stronger guarantees of compile-time generation but I'm not sure about which parts could be converted or what the compiler support is for consteval. |
|
In practice, what we care about is that the static variables are compile-time constants and not initialized at runtime. Being declared as |
This avoids constructing two unordered maps and numerous vectors for each IL level at library load time for each plug-in that uses the C++ API. Additionally, the arrays allow for more efficient look-ups.
7ba96c1 to
62ded0d
Compare
8440e4f to
290bbcf
Compare
This avoids constructing numerous unordered maps and vectors at library load time in every plug-in that uses the C++ API. Additionally, the arrays allow for more efficient look-ups.