Skip to content

Commit aa50e3f

Browse files
committed
Make: Consistent -O2 setting
1 parent 25085c1 commit aa50e3f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ default = ["std"]
1919
std = []
2020

2121
[profile.release]
22-
opt-level = 3 # Corresponds to -O3
22+
opt-level = 2 # Corresponds to -O2
2323
lto = true # Enables Link Time Optimization for further optimizations
2424
codegen-units = 1 # May increase compilation time but optimizes further
2525
rpath = false # On some systems, setting this to false can help with optimizations

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() -> Result<(), cc::Error> {
66
.file("c/lib.cpp")
77
.include("include")
88
.define("FU_ENABLE_NUMA", "0")
9-
.opt_level(3) // Set optimization level to 2
9+
.opt_level(2) // Optimize compiled C++ to -O2
1010
.warnings(false);
1111

1212
// Platform-specific C++ standard flags

scripts/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function (set_target_properties_for_fork_union_script target_name)
1111
# In release mode, enable optimizations
1212
if (CMAKE_BUILD_TYPE STREQUAL "Release")
1313
message(STATUS "Enabling optimizations for ${target_name}")
14-
target_compile_options(${target_name} PRIVATE -O3)
14+
target_compile_options(${target_name} PRIVATE -O2)
1515
endif ()
1616

1717
# if we're not in Release mode

0 commit comments

Comments
 (0)