This is an archive of the discontinued LLVM Phabricator instance.

Further reduce the number of allocators
Needs ReviewPublic

Authored by espindola on Oct 26 2016, 12:42 PM.

Details

Reviewers
ruiu
Summary

This uses the same allocators for sections.

It ranges from a tiny slowdown to a quite noticeable speedup.

In a followup patch I will try to further reduce the number of allocators and simplify the code by using a global variable.

Diff Detail

Event Timeline

rafael retitled this revision from to Further reduce the number of allocators.
rafael updated this object.
rafael added a reviewer: ruiu.
rafael added a subscriber: llvm-commits.

The perf numbers I got:

firefox

master 7.177125163
patch  7.182606942 1.00076378479x slower

firefox-gc

master 7.374067189
patch  7.381466572 1.00100343309x slower

chromium

master 5.120661949
patch  4.981522129 1.02793118577x faster

chromium fast

master 1.963941995
patch  1.85967246 1.05606876331x faster

the gold plugin

master 0.347964045
patch  0.340951595 1.02056728903x faster

clang

master 0.589530331
patch  0.578198657 1.01959823646x faster

llvm-as

master 0.034089395
patch  0.03350961 1.01730205156x faster

the gold plugin fsds

master 0.376985041
patch  0.370091689 1.01862606539x faster

clang fsds

master 0.671836293
patch  0.662105439 1.01469683441x faster

llvm-as fsds

master 0.031508503
patch  0.031008237 1.01613332612x faster

scylla

master 3.220639954
patch  3.22094804 1.00009565987x slower
ruiu edited edge metadata.Oct 26 2016, 1:20 PM

With your change to call _exit, you can't see any difference in performance, no? Because this change is a bit complicated, I'd want to not have this one if it doesn't improve performance in normal use cases.

ruiu added a comment.Oct 26 2016, 2:26 PM

I wonder if we add a virtual dtor to InputSection. Do you think it's too expensive?

ruiu added a comment.Oct 26 2016, 5:02 PM

I don't think I fully understand why this can make things faster. This patch replaces

llvm::SpecificBumpPtrAllocator<[derived class of InputSection]>

with

std::unique_ptr<InputSection>,

so the number of allocations and the number of deallocation (which should be zero if _exit is called) don't change, IIUC.

espindola commandeered this revision.Mar 15 2018, 8:57 AM
espindola added a reviewer: rafael.