| 1016 | } |
| 1017 | |
| 1018 | double snprintfRAMCloud() |
| 1019 | { |
| 1020 | struct timespec now; |
| 1021 | int count = 1000000; |
| 1022 | char buffer[1000]; |
| 1023 | |
| 1024 | clock_gettime(CLOCK_REALTIME, &now); |
| 1025 | uint64_t start = Cycles::rdtsc(); |
| 1026 | Util::serialize(); |
| 1027 | for (int i = 0; i < count; ++i) { |
| 1028 | snprintf(buffer, 1000, |
| 1029 | "%010lu.%09lu %s:%d in %s %s[%d]: %s %0.6lf", |
| 1030 | now.tv_sec, now.tv_nsec, __FILE__, __LINE__, |
| 1031 | __func__, "Debug", 100, |
| 1032 | "Using tombstone ratio balancer with ratio =", 0.4); |
| 1033 | } |
| 1034 | Util::serialize(); |
| 1035 | uint64_t stop = Cycles::rdtsc(); |
| 1036 | |
| 1037 | return Cycles::toSeconds(stop - start)/count; |
| 1038 | } |
| 1039 | |
| 1040 | // Measure the cost of reading the fine-grain cycle counter. |
| 1041 | double rdtscTest() |