mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 04:25:51 +00:00
Performance test
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -155,7 +155,7 @@ private:
|
|||||||
mutable std::mutex batchMutex_;
|
mutable std::mutex batchMutex_;
|
||||||
static constexpr size_t BATCH_BUFFER_SIZE = 64 * 1024; // 64KB buffer
|
static constexpr size_t BATCH_BUFFER_SIZE = 64 * 1024; // 64KB buffer
|
||||||
std::array<char, BATCH_BUFFER_SIZE> batchBuffer_{};
|
std::array<char, BATCH_BUFFER_SIZE> batchBuffer_{};
|
||||||
std::span<char> writeBuffer_; // Points to available write space
|
static thread_local std::span<char> writeBuffer_; // Points to available write space
|
||||||
std::span<char> readBuffer_; // Points to data ready to flush
|
std::span<char> readBuffer_; // Points to data ready to flush
|
||||||
std::chrono::steady_clock::time_point lastFlush_ =
|
std::chrono::steady_clock::time_point lastFlush_ =
|
||||||
std::chrono::steady_clock::now();
|
std::chrono::steady_clock::now();
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
thread_local std::span<char> Logs::writeBuffer_{};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr auto FLUSH_INTERVAL =
|
constexpr auto FLUSH_INTERVAL =
|
||||||
@@ -129,8 +130,8 @@ Logs::File::write(std::string_view text)
|
|||||||
|
|
||||||
Logs::Logs(beast::severities::Severity thresh)
|
Logs::Logs(beast::severities::Severity thresh)
|
||||||
: thresh_(thresh) // default severity
|
: thresh_(thresh) // default severity
|
||||||
, writeBuffer_(
|
// , writeBuffer_(
|
||||||
batchBuffer_) // Initially, entire buffer is available for writing
|
// batchBuffer_) // Initially, entire buffer is available for writing
|
||||||
, readBuffer_(batchBuffer_.data(), 0) // No data ready to flush initially
|
, readBuffer_(batchBuffer_.data(), 0) // No data ready to flush initially
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user