Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Make binaries faster on release profile through better compile options #606

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

loiclec
Copy link
Contributor

@loiclec loiclec commented Aug 17, 2022

Using codegen-units = 1 and lto = 'thin' makes the compile time a bit longer, but also produces faster binaries.

I'd like to run milli's benchmark with these options, so that we can see whether it is worth enabling on meilisearch.

@loiclec loiclec added no breaking The related changes are not breaking (DB nor API) maintenance Issue about maintenance (CI, tests, refacto...) performance Related to the performance in term of search/indexation speed or RAM/CPU/Disk consumption labels Aug 17, 2022
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these options matter for a library?

Cargo.toml Show resolved Hide resolved
@loiclec
Copy link
Contributor Author

loiclec commented Aug 17, 2022

They are not read when milli is compiled as a library. But for all the executables that are part of the workspace (benchmarks, cli, etc.), it should make things a bit faster. If we decide to add them to meilisearch, then I think it's best to have them enabled for the benchmarks as well I think.

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors
Copy link
Contributor

bors bot commented Aug 17, 2022

@bors bors bot merged commit f55034e into main Aug 17, 2022
@bors bors bot deleted the faster-release-profile branch August 17, 2022 09:26
bors bot added a commit to meilisearch/meilisearch that referenced this pull request Aug 23, 2022
2689: Use mimalloc as the global allocator r=Kerollmops a=loiclec

milli has switched its global allocator to mimalloc already, and we have seen some performance gains as a result. Furthermore, we can use mimalloc as the global allocator on all platforms whereas jemalloc was only activated on Linux. 

This PR brings mimalloc to Meilisearch as well. 

2690: Add LTO and codegen-units=1 to release compile options r=Kerollmops a=loiclec

This PR brings Meilisearch's release compile options in line with milli (see meilisearch/milli#606 ). 

Adding LTO and codegen=units=1 will make compile times longer, but they also speed up the final binary significantly.

Co-authored-by: Loïc Lecrenier <loic@meilisearch.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintenance Issue about maintenance (CI, tests, refacto...) no breaking The related changes are not breaking (DB nor API) performance Related to the performance in term of search/indexation speed or RAM/CPU/Disk consumption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants