Questa pagina non è ancora nella sua lingua. Sta leggendo il testo in inglese.
Glossary
Link time optimization
Link time optimization is a compiler mode that optimizes a program across all of its files at the final linking step.
Where the optimizer gets a wider view
Without the mode each source file is optimized on its own and the linker only puts the finished pieces together.
With it the optimizer runs again at the link step, where it can see across the whole program at once.
Why memory settles the mode
Linking is the hungriest step of a browser build, because the linker holds the entire program in memory at one moment.
Chromium states its own appetite for that step and asks for a further reserve on top of it. Below a memory threshold nothing fits at any number of parallel jobs, and the build would die on the last step after many hours of work.
Settings that cannot stand together
Chromium forbids setting the number of parallel links by hand while this mode is on, and generation halts on that assertion.
So both are decided in one place. The mode on and the count left to Chromium, or the mode off and links taken one at a time.
One rule for every system
The same file answers for the macOS and the Linux builds, so a difference cannot appear on somebody else's machine.
A neighbour rides along
Control flow integrity requires the mode, so switching the mode off on one Linux target switches that check off as well.
Otherwise generation halts
That second assertion fires only on that one target, which is exactly where it would be noticed last.
A build without it is still a shipping build
Turning the mode off does not turn the result into a development build. It stays a shipping build with no debug symbols and with the reporting code cut out.
What changes is how much the optimizer managed to polish, and nothing a page can read.
Which mode a build used
The generator leaves every accepted setting in a file beside the build output, and this one stands there with its neighbours.
So the mode is a fact about a particular build rather than a claim about the product.
Often confused with
Profile guided optimization
That mode learns from recorded runs of the program, and this engine is built without those recordings at all.
Stripping symbols
Removing debugging symbols makes a download smaller and changes nothing about how fast the code runs.
Obfuscation
Nothing here is made harder to read on purpose, and the optimizer works on machine code rather than on names.
What this does not do
- It changes nothing a site reads. The values a page gets come from the patch set and the profile seed, and they are identical in both modes.
- Its effect on this engine's speed is not measured here, so no number for it appears on this site. The mode is chosen to let a build finish, not to win a benchmark.
- It does not make a build shorter. The mode adds work to the last step, and the whole compile takes longer with it than without.
- It does not decide itself on your own machine. The rule reads the memory of the machine doing the building, and the choice follows from that alone.
Check it
Each line above is a file you can open and a stand that keeps it honest.
- The memory rule that chooses the mode
- engine/scripts/настройки-памяти.sh
- The two settings are never written out together
- apps/desktop/test/сборочные-скрипты.js
- Where the chosen mode is written down beside the build
- engine/scripts/build-mac.sh
- The Linux build reads the same rule
- engine/scripts/build-linux.sh
Questions
- Is a browser built without it slower?
- In theory the optimizer has less room to work in, and nobody has measured the difference on this engine. What a site reads is the same either way.
- Can I force the mode on?
- The rule reads the memory of the build machine and chooses from that. Forcing it on where memory is short ends the build at the link step, after the hours that came before it.
- Which mode did a given build use?
- The generator writes the setting into a file next to the build output, and that file is the record of what was chosen for that build.
- Does the mode change the version or the name?
- No. It changes how the machine code was optimized and nothing about what the browser reports about itself.
- Why not always build on a large machine?
- A build runs where the sources and the disk are. The rule exists so the same scripts finish on whichever machine is free that night.
Read what the finished build declares
The engine page lists every surface the build closes and names the stand that measures each one.