mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:27:14 +00:00
[api] Only apply -O2 to libsodium, not noise-c
CodSpeed results show only Noise benchmarks improved with -O2 — the speedup comes from libsodium's crypto primitives (Curve25519, ChaCha20, Poly1305), not noise-c's protocol layer. Narrow the optimization to libsodium only.
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
# Compile crypto libraries with -O2 for speed instead of the default -Os.
|
# Compile libsodium with -O2 for speed instead of the default -Os.
|
||||||
# Crypto is CPU-bound and benefits significantly from speed optimization.
|
# libsodium provides the crypto primitives (Curve25519, ChaCha20, Poly1305)
|
||||||
# GCC uses the last -O flag, so appending -O2 overrides the global -Os
|
# used by the Noise protocol and benefits significantly from speed optimization.
|
||||||
# for these libraries only.
|
# GCC uses the last -O flag, so appending -O2 overrides the global -Os.
|
||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
for lb in env.GetLibBuilders():
|
for lb in env.GetLibBuilders():
|
||||||
if lb.name in ("noise-c", "libsodium"):
|
if lb.name == "libsodium":
|
||||||
lb.env.Append(CCFLAGS=["-O2"])
|
lb.env.Append(CCFLAGS=["-O2"])
|
||||||
|
|||||||
Reference in New Issue
Block a user