@@ -25,9 +25,11 @@ TEST(ArcReplacerPerformanceTest, RecordAccessPerformanceTest) {
2525 // Test RecordAccess performance
2626 std::cout << " This test will see how your RecordAccess performs when the list is large. " << std::endl;
2727 std::cout << " If this takes above 3s on average, "
28- " you might get into trouble trying to get full score in some following projects... " << std::endl;
28+ " you might get into trouble trying to get full score in some following projects... "
29+ << std::endl;
2930 std::cout << " if you care, you may want to think of "
30- " what could be very slow when the list is very large, and how to make that faster" << std::endl;
31+ " what could be very slow when the list is very large, and how to make that faster"
32+ << std::endl;
3133 const size_t bpm_size = 256 << 10 ; // 1GB
3234 ArcReplacer arc_replacer (bpm_size);
3335 // Fillup mfu with lots of pages
@@ -42,23 +44,23 @@ TEST(ArcReplacerPerformanceTest, RecordAccessPerformanceTest) {
4244 std::vector<size_t > access_times;
4345 for (size_t round = 0 ; round < rounds; round++) {
4446 auto start_time = std::chrono::system_clock::now ();
45- for (size_t i= 0 ; i < bpm_size; i++) {
47+ for (size_t i = 0 ; i < bpm_size; i++) {
4648 arc_replacer.RecordAccess (access_frame_id, access_frame_id);
4749 access_frame_id = (access_frame_id + 1 ) % bpm_size;
4850 }
4951 auto end_time = std::chrono::system_clock::now ();
50- access_times.push_back (
51- std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count ());
52+ access_times.push_back (std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count ());
5253 }
5354 double total = 0 ;
5455 for (const auto &x : access_times) {
5556 total += x;
5657 }
5758 total /= 1000 ;
5859 double avg = total / access_times.size ();
59- std::cout << " Average time used: " << avg << " s. If this takes above 3s on average, "
60- " you might get into trouble trying to get full score in some following projects... "
61- " if you care, try optimizing RecordAccess for a bit" ;
60+ std::cout << " Average time used: " << avg
61+ << " s. If this takes above 3s on average, "
62+ " you might get into trouble trying to get full score in some following projects... "
63+ " if you care, try optimizing RecordAccess for a bit" ;
6264 ASSERT_LT (avg, 3 );
6365}
6466
0 commit comments