Skip to content

Commit

Permalink
Define buffer size in benchmark according to user's cpu architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlon Marshall committed Oct 23, 2024
1 parent 9c291c9 commit da75262
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/performance/target/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@
#include <benchmark/benchmark.h>
#include <stumpless.h>
#include "test/helper/memory_counter.hpp"
#define MAX_BUFFER_SIZE (1024 * 1024 * 1024 * 1) // 1 GB

// Define size constants
#define SIZE_4KB (4ull * 1024ull)
#define SIZE_16KB (16ull * 1024ull)
#define SIZE_32KB (32ull * 1024ull)

#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__)
#define MAX_BUFFER_SIZE SIZE_32KB
#elif defined(__i386__) || defined(_M_IX86) || defined(__arm__)
#define MAX_BUFFER_SIZE SIZE_16KB
#else
#define MAX_BUFFER_SIZE SIZE_4KB
#endif

NEW_MEMORY_COUNTER( buffer );

Expand Down

0 comments on commit da75262

Please sign in to comment.