-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add -flto=thin to mac aarch64 build cflags for ez 10% gain (#469)
Adds somewhere between 5-10% improvement to wall time. I've ran all tests, booted several fakeships and comets with this installed, and all seems to work properly. Mac x86 is coming, I just don't have access to an intel mac right now [but soon...]. Linux will come later once I figure out some bugs. The following is time to boot a fakeship from a brass pill: ``` Without LTO: ________________________________________________________ Executed in 180.46 secs fish external usr time 17.83 secs 0.10 millis 17.83 secs sys time 0.23 secs 1.86 millis 0.23 secs With LTO: ________________________________________________________ Executed in 164.87 secs fish external usr time 15.65 secs 0.12 millis 15.65 secs sys time 0.19 secs 1.94 millis 0.19 secs ``` 180/164 -> 1.09 --- ~barter-simsum ## Brass pill boot: x86 linux without lto: ~140s x86 linux with lto: ~128s ~ 8.6% improvement - note we may be able to squeeze a bit more out if we can apply `-flto` to all dependencies and not just urbit binaries. This is currently an issue for x86 linux though due to some weird uninvestigated behavior with libsigsegv ## For those curious, the following hints at what was inlined ``` readelf -s ./bazel-bin/pkg/vere/urbit | grep lto_priv 1233: 000000000042d0f0 361 FUNC LOCAL DEFAULT 2 _rebalance.lto_priv.1 1237: 000000000042d6c0 435 FUNC LOCAL DEFAULT 2 _rebalance.lto_priv.0 13002: 0000000000d24a00 200 OBJECT GLOBAL HIDDEN 14 u3_Signal.lto_priv.0 13358: 0000000000d36de0 8 OBJECT GLOBAL HIDDEN 14 sec_u.lto_priv.0 13429: 0000000000d24ae0 80 OBJECT GLOBAL HIDDEN 14 u3V.lto_priv.0 13785: 00000000004516e0 110 FUNC GLOBAL HIDDEN 2 _tap_in.lto_priv.0 14094: 0000000000d3aeb0 4 OBJECT GLOBAL HIDDEN 14 sag_w.lto_priv.0 14100: 0000000000469af0 971 FUNC GLOBAL HIDDEN 2 _lord_stop.lto_priv.0 14120: 00000000004581f0 393 FUNC GLOBAL HIDDEN 2 _cj_nail.lto_priv.0 14178: 0000000000456a30 450 FUNC GLOBAL HIDDEN 2 _cj_fine.lto_priv.0 14732: 0000000000463eb0 82 FUNC GLOBAL HIDDEN 2 _box_free.lto_priv.0 14849: 000000000044a320 658 FUNC GLOBAL HIDDEN 2 _n_find.lto_priv.0 15325: 0000000000478dd0 1487 FUNC GLOBAL HIDDEN 2 _pier_init.lto_priv.0 15413: 00000000004674a0 939 FUNC GLOBAL HIDDEN 2 _ca_willoc.lto_priv.0 15841: 0000000000477300 394 FUNC GLOBAL HIDDEN 2 _dawn_fail.lto_priv.0 16128: 00000000004449d0 1746 FUNC GLOBAL HIDDEN 2 _cr_sing.lto_priv.0 16214: 0000000000474c40 500 FUNC GLOBAL HIDDEN 2 _ttyf_loja.lto_priv.0 16277: 000000000078fe48 8 OBJECT GLOBAL HIDDEN 5 ver_hos_c.lto_priv.0 16887: 0000000000443ab0 460 FUNC GLOBAL HIDDEN 2 _n_bam.lto_priv.0 17346: 000000000045cc90 540 FUNC GLOBAL HIDDEN 2 _cj_minx.lto_priv.0 17897: 0000000000d249e8 8 OBJECT GLOBAL HIDDEN 14 _file_u.lto_priv.0 18325: 00000000004447a0 58 FUNC GLOBAL HIDDEN 2 _n_feb.lto_priv.0 18517: 00000000004453e0 3981 FUNC GLOBAL HIDDEN 2 _n_comp.lto_priv.0 18739: 0000000000d249f6 1 OBJECT GLOBAL HIDDEN 14 _ct_lop_o.lto_priv.0 18880: 000000000044fda0 1650 FUNC GLOBAL HIDDEN 2 _find_home.lto_priv.0 19091: 0000000000474e40 500 FUNC GLOBAL HIDDEN 2 _ttyf_hija.lto_priv.0 19508: 0000000000450420 1393 FUNC GLOBAL HIDDEN 2 _pave_home.lto_priv.0 19595: 000000000042a3d0 687 FUNC GLOBAL HIDDEN 2 _in_uni.lto_priv.0 19822: 0000000000430e20 1095 FUNC GLOBAL HIDDEN 2 _block_rip.lto_priv.0 20236: 0000000000457030 331 FUNC GLOBAL HIDDEN 2 _cj_axis.lto_priv.0 20306: 0000000000457180 514 FUNC GLOBAL HIDDEN 2 _cj_gust.lto_priv.0 20866: 0000000000456c00 667 FUNC GLOBAL HIDDEN 2 _cj_cast.lto_priv.0 21317: 0000000000446fe0 11412 FUNC GLOBAL HIDDEN 2 _n_burn.lto_priv.0 21430: 000000000045c820 1130 FUNC GLOBAL HIDDEN 2 _cj_spot.lto_priv.0 ```
- Loading branch information
Showing
12 changed files
with
117 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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