#include #include #include "perftools.hpp" #include "priority_queue.hpp" using namespace std; int main() { // PQ is an open ended data structure -> alloc an arbitrary mem amount PriorityQueue *pq; Timer *timer = new Timer(); int trans = 1000000; int maxBase = 1024 * 1024; void *mem = malloc(20 * 1024 * 1024); for (int i=0; idiff(), trans, (char*) "raw PRNG"); for (int base=1; base<=maxBase; base*=2) { // setup queue pq = new(mem) PriorityQueue(); for (int i=0; iinsert(drand48(),0); // test queue timer = new Timer(); for (int i=0; iinsert(i, 0); pq->removeMin(); } print_throughput2(timer->diff(), trans, base); } return 0; }