mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-12 01:30:18 +00:00
Compare commits
2 Commits
pratik/ote
...
perf/alloc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
997d066b65 | ||
|
|
162093680b |
@@ -242,7 +242,7 @@ elseif(use_gold AND is_gcc)
|
||||
disabling would be to figure out all the settings
|
||||
required to make gold play nicely with jemalloc.
|
||||
#]=========================================================]
|
||||
if(("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc))
|
||||
if(("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc) AND (NOT tcmalloc))
|
||||
target_link_libraries(
|
||||
common
|
||||
INTERFACE
|
||||
|
||||
@@ -54,6 +54,11 @@ if(jemalloc)
|
||||
target_link_libraries(opts INTERFACE jemalloc::jemalloc)
|
||||
endif()
|
||||
|
||||
if(tcmalloc)
|
||||
find_package(gperftools REQUIRED)
|
||||
target_link_libraries(opts INTERFACE gperftools::gperftools)
|
||||
endif()
|
||||
|
||||
#[===================================================================[
|
||||
xrpld transitive library deps via an interface library
|
||||
#]===================================================================]
|
||||
|
||||
@@ -125,6 +125,10 @@ else()
|
||||
endif()
|
||||
|
||||
option(jemalloc "Enables jemalloc for heap profiling" OFF)
|
||||
option(tcmalloc "Link xrpld against tcmalloc (gperftools) as the global allocator" OFF)
|
||||
if(jemalloc AND tcmalloc)
|
||||
message(FATAL_ERROR "jemalloc and tcmalloc are mutually exclusive")
|
||||
endif()
|
||||
option(werr "treat warnings as errors" OFF)
|
||||
option(
|
||||
local_protobuf
|
||||
|
||||
10
conanfile.py
10
conanfile.py
@@ -3,6 +3,7 @@ import re
|
||||
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.errors import ConanInvalidConfiguration
|
||||
|
||||
|
||||
class Xrpl(ConanFile):
|
||||
@@ -21,6 +22,7 @@ class Xrpl(ConanFile):
|
||||
"rocksdb": [True, False],
|
||||
"shared": [True, False],
|
||||
"static": [True, False],
|
||||
"tcmalloc": [True, False],
|
||||
"telemetry": [True, False],
|
||||
"tests": [True, False],
|
||||
"unity": [True, False],
|
||||
@@ -53,6 +55,7 @@ class Xrpl(ConanFile):
|
||||
"rocksdb": True,
|
||||
"shared": False,
|
||||
"static": True,
|
||||
"tcmalloc": False,
|
||||
"telemetry": True,
|
||||
"tests": False,
|
||||
"unity": False,
|
||||
@@ -125,6 +128,10 @@ class Xrpl(ConanFile):
|
||||
self.version = match.group(1)
|
||||
|
||||
def configure(self):
|
||||
if self.options.tcmalloc and self.options.jemalloc:
|
||||
raise ConanInvalidConfiguration(
|
||||
"jemalloc and tcmalloc cannot both be enabled"
|
||||
)
|
||||
if self.settings.compiler == "apple-clang":
|
||||
self.options["boost"].visibility = "global"
|
||||
if self.settings.compiler in ["clang", "gcc"]:
|
||||
@@ -135,6 +142,8 @@ class Xrpl(ConanFile):
|
||||
self.requires("date/3.0.4", transitive_headers=True)
|
||||
if self.options.jemalloc:
|
||||
self.requires("jemalloc/5.3.1")
|
||||
if self.options.tcmalloc:
|
||||
self.requires("gperftools/2.16")
|
||||
self.requires("lz4/1.10.0", force=True)
|
||||
self.requires("mpt-crypto/0.4.0-rc2", transitive_headers=True)
|
||||
self.requires("protobuf/6.33.5", force=True)
|
||||
@@ -171,6 +180,7 @@ class Xrpl(ConanFile):
|
||||
tc.variables["assert"] = self.options.assertions
|
||||
tc.variables["coverage"] = self.options.coverage
|
||||
tc.variables["jemalloc"] = self.options.jemalloc
|
||||
tc.variables["tcmalloc"] = self.options.tcmalloc
|
||||
tc.variables["rocksdb"] = self.options.rocksdb
|
||||
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
|
||||
tc.variables["static"] = self.options.static
|
||||
|
||||
@@ -1129,7 +1129,8 @@ public:
|
||||
<< "; size after: " << cachedSLEs_.size();
|
||||
}
|
||||
|
||||
mallocTrim("doSweep", journal_);
|
||||
// Disabled for allocator benchmark: no proactive malloc_trim on sweep.
|
||||
// mallocTrim("doSweep", journal_);
|
||||
|
||||
// Set timer to do another sweep later.
|
||||
setSweepTimer();
|
||||
|
||||
Reference in New Issue
Block a user