mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
bst_vs_heap_vs_hashmap: use small size by default
This allows us to add it to regressions. Also clarify that the gem5 run blew up.
This commit is contained in:
@@ -1,48 +1,5 @@
|
||||
// https://github.com/cirosantilli/linux-kernel-module-cheat#bst-vs-heap-vs-hashmap
|
||||
|
||||
//#include <algorithm>
|
||||
//#include <iostream>
|
||||
//#include <queue>
|
||||
//#include <random>
|
||||
//#include <set>
|
||||
//
|
||||
//#include <lkmc/m5ops.h>
|
||||
//
|
||||
//int main(int argc, char **argv) {
|
||||
// typedef uint64_t I;
|
||||
// std::vector<I> randoms;
|
||||
// size_t i, n;
|
||||
// std::priority_queue<I> heap;
|
||||
// std::set<I> bst;
|
||||
// unsigned int seed = std::random_device()();
|
||||
//
|
||||
// // CLI arguments.
|
||||
// if (argc > 1) {
|
||||
// n = std::stoi(argv[1]);
|
||||
// } else {
|
||||
// n = 1;
|
||||
// }
|
||||
//
|
||||
// // Action.
|
||||
// for (i = 0; i < n; ++i) {
|
||||
// randoms.push_back(i);
|
||||
// }
|
||||
// std::shuffle(randoms.begin(), randoms.end(), std::mt19937(seed));
|
||||
// for (i = 0; i < n; ++i) {
|
||||
// auto random = randoms[i];
|
||||
//
|
||||
// // Heap.
|
||||
// LKMC_M5OPS_RESETSTATS;
|
||||
// heap.emplace(random);
|
||||
// LKMC_M5OPS_DUMPSTATS;
|
||||
//
|
||||
// // BST.
|
||||
// LKMC_M5OPS_RESETSTATS;
|
||||
// bst.insert(random);
|
||||
// LKMC_M5OPS_DUMPSTATS;
|
||||
// }
|
||||
//}
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
@@ -67,7 +24,7 @@ int main(int argc, char **argv) {
|
||||
if (argc > 1) {
|
||||
n = std::stoi(argv[1]);
|
||||
} else {
|
||||
n = 10000000;
|
||||
n = 10;
|
||||
}
|
||||
#ifdef LKMC_M5OPS_ENABLE
|
||||
// Let's comment useless stuff out to speed up gem5 simulations.
|
||||
@@ -77,7 +34,7 @@ int main(int argc, char **argv) {
|
||||
if (argc > 2) {
|
||||
granule = std::stoi(argv[2]);
|
||||
} else {
|
||||
granule = 10000;
|
||||
granule = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user