This is an archive of the discontinued LLVM Phabricator instance.

Exit early
AbandonedPublic

Authored by rafael on Feb 22 2016, 6:58 AM.

Details

Reviewers
ruiu
Summary

When linking our job is done as soon as the file is written, and the liker can just exit.

The situation is a bit more complicated with the current library arrangements since we unfortunately support running in the same process.

This is in the noise when linking clang, but with scyla it goes from 3.894365061 seconds to 3.879345710 seconds (1.0038 times faster). It would be interesting to see numbers on windows too, but I only have a windows VM.

Diff Detail

Repository
rL LLVM

Event Timeline

rafael updated this revision to Diff 48672.Feb 22 2016, 6:58 AM
rafael retitled this revision from to Exit early.
rafael updated this object.
rafael added a reviewer: ruiu.
rafael set the repository for this revision to rL LLVM.
rafael added a subscriber: llvm-commits.
emaste added a subscriber: emaste.Feb 22 2016, 7:17 AM
ruiu edited edge metadata.Feb 22 2016, 2:40 PM

1.0038x is not a large difference. We may be OK with this patch, but can you find a stronger evidence that exiting like this is more effective than that?

I wrote it mostly for sanity when benchmarking other ideas of how to
write the data out. For example, I want to properly benchmark using
anonymous memory + write and play with async write, but want to make
sure to not include extra shutdown costs.

I will benchmark it on OS X (laptop) and windows (VM).

On OS X there is no perf, so I had to write a small python script to
time it (attached).

clang: 1.016X faster.

scylla: 1.004X faster.

Cheers,
Rafael

rafael abandoned this revision.Feb 23 2016, 8:35 AM

On windows calling _exit actually seems a bit slower (but measuring on the VM is really noisy).

I will keep this as a local branch for now to use when testing other changes and bring it up again if it is particularly beneficial at some point.