Browse Source

feat: try unordered_map reserve

master
Dnomd343 2 years ago
parent
commit
ea150b0071
  1. 5
      src/fast_cal/fast_cal.cc
  2. 3
      src/main.cc

5
src/fast_cal/fast_cal.cc

@ -59,6 +59,11 @@ void FastCal::fast_cal(uint64_t code) {
// };
// cache.emplace(&cases[code]);
// cases.reserve(30000);
cases.reserve(65536);
// cases.reserve(65536 * 2);
// cases.reserve(65536 * 4);
cache.emplace(&cases.emplace(code, fast_cal_t {
.code = code,
.mask = 0,

3
src/main.cc

@ -11,6 +11,7 @@
#include <thread>
#include <algorithm>
#include <unistd.h>
//void get_status() {
// switch (BasicRanges::status()) {
@ -215,5 +216,7 @@ int main() {
std::cout << (clock() - start_time) * 1000000 / CLOCKS_PER_SEC << "us" << std::endl;
// std::cout << "complete benchmark" << std::endl;
// pause();
return 0;
}

Loading…
Cancel
Save