-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unity builds #2036
Comments
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. In order to make this work on Windows, we needed a small fix to how ANTLR4 is built. Closes #2036.
Riolku
added a commit
that referenced
this issue
Nov 22, 2023
Link-Time Optimization is a technique whereby the linker performs optimizations at the final step, right before generating the final executable or shared library. This provides significant performance and binary size optimizations, since the linker has access to all the context needed, unlike the individual optimizer passes, but in exchange linking takes a lot of time and memory. Based on some reading and some experimentation, Unity Builds, though they can offer similar benefits, are not nearly as good for optimization, and instead are primarily used for speeding up compile times. Additionally, Unity builds are harder to get right and harder to debug. LTO on the other hand is a very simple change, and seems to be the main area of focus right now. In order to make this work on Windows, we needed a small fix to how ANTLR4 is built. Closes #2036.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unity builds (where we amalgamate source files before compiling) can offer compilation and runtime speedups. CMake has builtin support for it.
Tasks:
#pragma once
(this is not currently the case).As for combining all the source files into one, this is generally not recommended, according to the CMake Documentation, though it is possible. It is something we could consider trying out, though the memory usage promises to be extremely high. In general, we could play around with batch sizes and see what runtime gains there are to be had.
The text was updated successfully, but these errors were encountered: