Skip to content

Commit 45a4f44

Browse files
committed
Performance test
Signed-off-by: JCW <[email protected]>
1 parent 211d90d commit 45a4f44

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/xrpl/basics/Log.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ class Logs
153153

154154
// Batching members
155155
mutable std::mutex batchMutex_;
156+
public:
156157
static constexpr size_t BATCH_BUFFER_SIZE = 64 * 1024; // 64KB buffer
157158
std::array<char, BATCH_BUFFER_SIZE> batchBuffer_{};
158-
static thread_local std::span<char> writeBuffer_; // Points to available write space
159+
std::span<char> writeBuffer_; // Points to available write space
159160
std::span<char> readBuffer_; // Points to data ready to flush
161+
private:
160162
std::chrono::steady_clock::time_point lastFlush_ =
161163
std::chrono::steady_clock::now();
162164

src/libxrpl/basics/Log.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <vector>
3838

3939
namespace ripple {
40-
thread_local std::span<char> Logs::writeBuffer_{};
4140

4241
namespace {
4342
constexpr auto FLUSH_INTERVAL =
@@ -130,8 +129,8 @@ Logs::File::write(std::string_view text)
130129

131130
Logs::Logs(beast::severities::Severity thresh)
132131
: thresh_(thresh) // default severity
133-
// , writeBuffer_(
134-
// batchBuffer_) // Initially, entire buffer is available for writing
132+
, writeBuffer_(
133+
batchBuffer_) // Initially, entire buffer is available for writing
135134
, readBuffer_(batchBuffer_.data(), 0) // No data ready to flush initially
136135
{
137136
}

0 commit comments

Comments
 (0)