This is an archive of the discontinued LLVM Phabricator instance.

Replace std::vector to std::array in SymbolSerializer
ClosedPublic

Authored by alex.telishev on Aug 20 2017, 1:42 PM.

Details

Summary

SymbolSerializer::writeOneSymbol function is called very often and creates a temporary SymbolSerializer
RecordBuffer is always created with a constant size so it's much faster to allocate this memory on the stack instead of heap

Diff Detail

Repository
rL LLVM

Event Timeline

alex.telishev created this revision.Aug 20 2017, 1:42 PM
zturner edited edge metadata.EditedAug 20 2017, 3:57 PM

The results of this and the other 2 patches look promising. Some initial benchmarks where I linked clang.exe using MSVC, lld with patch, and lld without patch are:

MSVC linker - 71.59s
lld without these 3 patches - 47.98s
lld with these 3 patches - 29.91s

Definitely a solid improvement. I'll run some more timings on Monday when I'm back in the office (as well as looking more closely at the 3 patches).

Thanks!

This revision was automatically updated to reflect the committed changes.