Don't assume compiler memoization #3
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See here.
Code like below (taken from the link) calls
build_node_list
three times, and there's a chance this causes the compile to recompute the list with every call. There is significant compilation overhead in this project, so I wouldn't be surprised if this is the case.Need to minimize recomputation, or find ways to avoid it altogether.
Forced memoization for the node list, tree count, and compressed size. The JSON example now compiles ~30% faster on my desktop. The sizes are stored in
constexpr static
variables, while the node list became aconstexpr static
object with aconsteval
constructor.My attempt at memoization for the node tree failed terribly (>100% increase in compile time). I did it in the same way I did for the node list, maybe I messed something up; I'll continue to look into it.