Annotations incur huge overhead #4974
Labels
compiler-performance
Topics on improving the performance of the compiler core.
core
Topics concerning the core segments of the compiler (frontend, midend, parser)
It seems that
Annotations
/Annotation
incur lots of overheads due to cloning during visiting:As one can see, the
Annotations
is behind the largest amount of memory allocations (and total size).Annotation
itself is also results in large memory overhead.There are multiple things that contribute to this:
Annotation
itself is large. It is supposed to be a union of different things (vector of tokens, vector of expressions or indexed vector), but instead it just hold all of them. As a result,Annotation
itself is 576 bytes and this is quite large node.Annotations
is also large: ~200 bytes, but more importantly it is cloned every timeIAnnotated
node is visited in theTransform
. The reason is simple: while it is optional, it is always initialized toAnnotations::empty
resulting to explicit copies during visiting.The text was updated successfully, but these errors were encountered: