Merge pull request #18518 from aconsroe-hpe/reduce-vector-allocations-1
Reduce vector allocations in compiler (pt 1)
reviewed by @mppf
These changes reduce allocations compiling hello world from 9717441 to 8231998 (15%) reduction and a 2% time improvement compiling arkouda.
I'm not in love with the class static but it is in line with the existing code. buildBasicBlocks is called 289502 times in compiling hello world and this saves us from having a caller pass it in and lets the size naturally fit (max size 576 w/ 99% of 7) to the workload. The max size does not present a high memory overhead if reset is not called (which it isn't currently).
The second change in computeAlignment does a one-time resize instead of repeated push_back as this will reallocate every time the size is grown.
Modified Files: M compiler/AST/bb.cpp