Skip to content

Commit 8b1a2fe

Browse files
authored
docs(build-from-source): update LTO instructions to use USE_MOLD option (#6081)
The previous instructions for enabling Link Time Optimization (LTO) using -DCMAKE_CXX_FLAGS="-flto" did not work as expected. Updated the documentation to recommend using -DUSE_MOLD=ON, which enables LTO and uses the mold linker for improved build performance and benchmarking. I've validated that it does work using readelf. Signed-off-by: Gil Levkovich <[email protected]> Co-authored-by: Gil Levkovich <[email protected]>
1 parent ef03ab7 commit 8b1a2fe

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

docs/build-from-source.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
Dragonfly runs on linux. We advise running it on linux version 5.11 or later
66
but you can also run Dragonfly on older kernels as well.
77

8-
> :warning: **Dragonfly releases are compiled with LTO (link time optimization)**:
9-
Depending on the workload this can notably improve performance. If you want to
10-
benchmark Dragonfly or use it in production, you should enable LTO by giving
11-
`blaze.sh` the `-DCMAKE_CXX_FLAGS="-flto"` argument.
12-
138
## Step 1 - install dependencies
149

1510
On Debian/Ubuntu:
@@ -59,12 +54,14 @@ cd build-opt && ninja dragonfly
5954

6055
### Build options
6156

62-
| Option | Description |
63-
|--|--|
64-
| WITH_AWS | Include AWS client. Required for cloud snapshots |
65-
| WITH_SEARCH | Include Search module |
66-
| WITH_COLLECTION_CMDS | Include commands for collections (SET, HSET, ZSET) |
67-
| WITH_EXTENSION_CMDS | Include extension commands (Bloom, HLL, JSON, ...) |
57+
58+
| Option | Description |
59+
| ---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60+
| WITH_AWS | Include AWS client. Required for cloud snapshots |
61+
| WITH_SEARCH | Include Search module |
62+
| WITH_COLLECTION_CMDS | Include commands for collections (SET, HSET, ZSET) |
63+
| WITH_EXTENSION_CMDS | Include extension commands (Bloom, HLL, JSON, ...) |
64+
| USE_MOLD | Uses the mold linker to reduce link time overhead while enabling Link Time Optimization (LTO) for improved runtime performance. Recommended for benchmarking and production. |
6865

6966
Minimal debug build:
7067

0 commit comments

Comments
 (0)