It is generally good practice, if you know how big the vector is going to be in the end, to reserve before continually calling "push_back" or "emplace_back"
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Paths
| Differential D139483
[llvm] Reserve memory before pushing back ClosedPublic Authored by gAlfonso-bit on Dec 6 2022, 4:04 PM.
Details
Summary It is generally good practice, if you know how big the vector is going to be in the end, to reserve before continually calling "push_back" or "emplace_back"
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Dec 6 2022, 4:07 PM gAlfonso-bit retitled this revision from Reserve memory before pushing back to [LLVM] Reserve memory before pushing back.Dec 7 2022, 2:51 PM MaskRay retitled this revision from [LLVM] Reserve memory before pushing back to [llvm] Reserve memory before pushing back.Dec 8 2022, 12:38 AM Closed by commit rG7f86bb0a713c: [llvm] Call reserve before push_back in a loop (authored by gAlfonso-bit, committed by MaskRay). · Explain WhyDec 8 2022, 12:42 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 481181 llvm/include/llvm/Testing/Support/Error.h
llvm/lib/Support/VirtualFileSystem.cpp
llvm/tools/llvm-cov/CodeCoverage.cpp
llvm/tools/llvm-cov/CoverageReport.cpp
llvm/unittests/ADT/DenseMapTest.cpp
llvm/utils/TableGen/GlobalISelEmitter.cpp
llvm/utils/TableGen/OptParserEmitter.cpp
|
Drop unneeded change