In my test case max resident memory changed from 65760k to 64476k which is 1.9% improvement.
Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler.
Overall running time remained the same.
Differential D23329
[NFC] Reducing allocations in AST attributes kevgs on Aug 9 2016, 11:45 AM. Authored by
Details
Diff Detail Event TimelineComment Actions My test case is: clang++ -std=c++14 -fsyntax-only test.cc #include <algorithm> std::vector<int> v = {1, 2, 3}; std::for_each(v.begin(), v.end(), [](auto i) { std::cout << i; }); return 0; } |
Might as well clang-format this line.