Skip to content

Commit 55723db

Browse files
committed
add a memcpy baseline
1 parent 62ed60e commit 55723db

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

benchmarks/bench_ip.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ void pretty_print(size_t volume, size_t bytes, std::string name,
1313
counters::event_aggregate agg) {
1414
printf("%-40s : ", name.c_str());
1515
printf(" %5.2f GB/s ", bytes / agg.fastest_elapsed_ns());
16-
printf(" %5.1f Ma/s ", volume * 1000.0 / agg.fastest_elapsed_ns());
17-
printf(" %5.2f ns/d ", agg.fastest_elapsed_ns() / volume);
16+
printf(" %5.1f Mip/s ", volume * 1000.0 / agg.fastest_elapsed_ns());
17+
printf(" %5.2f ns/ip ", agg.fastest_elapsed_ns() / volume);
1818
if (counters::event_collector().has_events()) {
1919
printf(" %5.2f GHz ", agg.fastest_cycles() / agg.fastest_elapsed_ns());
20-
printf(" %5.2f c/d ", agg.fastest_cycles() / volume);
21-
printf(" %5.2f i/d ", agg.fastest_instructions() / volume);
20+
printf(" %5.2f c/ip ", agg.fastest_cycles() / volume);
21+
printf(" %5.2f i/ip ", agg.fastest_instructions() / volume);
2222
printf(" %5.2f c/b ", agg.fastest_cycles() / bytes);
2323
printf(" %5.2f i/b ", agg.fastest_instructions() / bytes);
2424
printf(" %5.2f i/c ", agg.fastest_instructions() / agg.fastest_cycles());
@@ -144,6 +144,13 @@ int main() {
144144
const size_t volume = N;
145145

146146
volatile uint32_t sink = 0;
147+
std::string buffer(ip_size * N, ' ');
148+
149+
pretty_print(volume, bytes, "memcpy baseline",
150+
counters::bench([&]() {
151+
std::memcpy((char *)buffer.data(), buf.data(), bytes);
152+
}));
153+
147154

148155
pretty_print(volume, bytes, "just_seek_ip_end (no parse)",
149156
counters::bench([&]() {

0 commit comments

Comments
 (0)