|
|
@@ -3,22 +3,28 @@
|
|
|
# Find OpenSSL for encryption
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
|
|
-# Find optional LZ4 for compression
|
|
|
-find_package(PkgConfig)
|
|
|
-if(PKG_CONFIG_FOUND)
|
|
|
- pkg_check_modules(LZ4 QUIET liblz4)
|
|
|
- pkg_check_modules(yyjson REQUIRED yyjson)
|
|
|
- # v1.9.4 — jemalloc replaces glibc malloc for the smartbotic-database
|
|
|
- # binary. The fragmentation pattern from per-RPC nlohmann::json node
|
|
|
- # churn (107k 33-byte allocations observed on Zoe) defeats glibc's
|
|
|
- # malloc_trim because the trailing region of each arena always has a
|
|
|
- # live chunk; jemalloc's background-thread dirty-page decay sidesteps
|
|
|
- # the contiguity requirement and reclaims unused pages on a wallclock
|
|
|
- # timer regardless of allocation activity. Linked as a library so
|
|
|
- # the binary picks up jemalloc's malloc/free symbols at link time;
|
|
|
- # no LD_PRELOAD needed.
|
|
|
- pkg_check_modules(JEMALLOC QUIET jemalloc)
|
|
|
-endif()
|
|
|
+# PkgConfig is REQUIRED because yyjson (v1.10+) is a hard build dependency.
|
|
|
+# LZ4 and jemalloc remain optional, but if pkg-config itself is missing we
|
|
|
+# fail at configure time rather than silently producing a yyjson-free binary
|
|
|
+# via empty ${yyjson_LIBRARIES} expansion.
|
|
|
+find_package(PkgConfig REQUIRED)
|
|
|
+
|
|
|
+# yyjson — phase A v1.10 hot-path JSON parser. Hard dependency.
|
|
|
+pkg_check_modules(yyjson REQUIRED yyjson)
|
|
|
+
|
|
|
+# Optional LZ4 for compression
|
|
|
+pkg_check_modules(LZ4 QUIET liblz4)
|
|
|
+
|
|
|
+# v1.9.4 — jemalloc replaces glibc malloc for the smartbotic-database
|
|
|
+# binary. The fragmentation pattern from per-RPC nlohmann::json node
|
|
|
+# churn (107k 33-byte allocations observed on Zoe) defeats glibc's
|
|
|
+# malloc_trim because the trailing region of each arena always has a
|
|
|
+# live chunk; jemalloc's background-thread dirty-page decay sidesteps
|
|
|
+# the contiguity requirement and reclaims unused pages on a wallclock
|
|
|
+# timer regardless of allocation activity. Linked as a library so
|
|
|
+# the binary picks up jemalloc's malloc/free symbols at link time;
|
|
|
+# no LD_PRELOAD needed.
|
|
|
+pkg_check_modules(JEMALLOC QUIET jemalloc)
|
|
|
|
|
|
# Source files
|
|
|
set(DATABASE_SERVICE_SOURCES
|
|
|
@@ -82,8 +88,9 @@ if(LZ4_FOUND)
|
|
|
target_include_directories(smartbotic-database PRIVATE ${LZ4_INCLUDE_DIRS})
|
|
|
endif()
|
|
|
|
|
|
-target_include_directories(smartbotic-database PRIVATE ${yyjson_INCLUDE_DIRS})
|
|
|
+# yyjson — phase A v1.10 hot-path JSON parser
|
|
|
target_link_libraries(smartbotic-database PRIVATE ${yyjson_LIBRARIES})
|
|
|
+target_include_directories(smartbotic-database PRIVATE ${yyjson_INCLUDE_DIRS})
|
|
|
|
|
|
# v1.9.4 — jemalloc allocator (overrides glibc malloc/free)
|
|
|
if(JEMALLOC_FOUND)
|