Performance test

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-09-11 08:26:57 +01:00
parent ebe0222ec9
commit c6b9426d31
2 changed files with 5 additions and 4 deletions

View File

@@ -153,10 +153,12 @@ private:
// Batching members
mutable std::mutex batchMutex_;
public:
static constexpr size_t BATCH_BUFFER_SIZE = 64 * 1024; // 64KB buffer
std::array<char, BATCH_BUFFER_SIZE> batchBuffer_{};
static thread_local std::span<char> writeBuffer_; // Points to available write space
std::span<char> writeBuffer_; // Points to available write space
std::span<char> readBuffer_; // Points to data ready to flush
private:
std::chrono::steady_clock::time_point lastFlush_ =
std::chrono::steady_clock::now();

View File

@@ -37,7 +37,6 @@
#include <vector>
namespace ripple {
thread_local std::span<char> Logs::writeBuffer_{};
namespace {
constexpr auto FLUSH_INTERVAL =
@@ -130,8 +129,8 @@ Logs::File::write(std::string_view text)
Logs::Logs(beast::severities::Severity thresh)
: thresh_(thresh) // default severity
// , writeBuffer_(
// batchBuffer_) // Initially, entire buffer is available for writing
, writeBuffer_(
batchBuffer_) // Initially, entire buffer is available for writing
, readBuffer_(batchBuffer_.data(), 0) // No data ready to flush initially
{
}