Makefile: add link-time optimization support#420
Open
pjonsson wants to merge 2 commits intodavidfrantz:developfrom
Open
Makefile: add link-time optimization support#420pjonsson wants to merge 2 commits intodavidfrantz:developfrom
pjonsson wants to merge 2 commits intodavidfrantz:developfrom
Conversation
Add flags for enabling link-time optmization during compilation by calling "make LTO=yes". I cannot find a definition of LDFLAGS, so just chuck it into GDAL_FLAGS which should be used for the binaries that does heavy computation. I don't have any performance comparisons, but compiling with LTO makes the binary noticeably smaller, before: $ ls -l `which force-l2ps` -rwxr-xr-x 1 root root 2668408 Mar 16 22:02 /usr/local/bin/force/force-l2ps and after: $ ls -l `which force-l2ps` -rwxr-xr-x 1 root root 1986848 Mar 16 22:14 /usr/local/bin/force/force-l2ps Reducing the binary size is likely to improve the instruction cache hit rate even if we pessimistically assume that LTO didn't manage to make any other optimization.
Contributor
Author
|
The sample size is 1, but here are some rough measurements of CPU-minutes required for creating a L2A product from a Sentinel-2 L1C product with
It's my desktop machine so there are web browsers and other things running in the background at the same time, but the window focused on by my mouse cursor was the FORCE container. |
Owner
|
This seems interesting. I will run some tests before merging, though |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add flags for enabling link-time
optmization during compilation
by calling "make LTO=yes" and use
this in the Dockerfile.
I cannot find a definition of
LDFLAGS, so just chuck it into
GDAL_FLAGS which should be used
for the binaries that does heavy
computation.
I don't have any performance
comparisons, but compiling with LTO
makes the binary noticeably smaller,
before:
$ ls -l
which force-l2ps-rwxr-xr-x 1 root root 2668408 Mar 16 22:02 /usr/local/bin/force/force-l2ps
and after:
$ ls -l
which force-l2ps-rwxr-xr-x 1 root root 1986848 Mar 16 22:14 /usr/local/bin/force/force-l2ps
Reducing the binary size is likely
to improve the instruction cache
hit rate even if we pessimistically
assume that LTO didn't manage to make
any other optimization.