diff --git a/README.md b/README.md index f2b8a6f..1f41bb1 100644 --- a/README.md +++ b/README.md @@ -133,4 +133,37 @@ TinySTL ######i = 10000000 -> (TinySTL::string:39ms \\ std::string:229ms) ######i = 100000000 -> (TinySTL::string:484ms \\ std::string:1965ms) +####(6):priority_queue<int> + + //std::priority_queue pq; + TinySTL::priority_queue pq; + ProfilerInstance::start(); + int i = 0; + for (; i != 100000; ++i){ + pq.push(i); + } + ProfilerInstance::finish(); + ProfilerInstance::dumpDuringTime(); + +######i = 100000 -> (TinySTL::priority_queue<int>:13ms \\ std::priority_queue<int>:12ms) +######i = 1000000 -> (TinySTL::priority_queue<int>:97ms \\ std::priority_queue<int>:67ms) +######i = 10000000 -> (TinySTL::priority_queue<int>:1032ms \\ std::priority_queue<int>:752ms) + + TinySTL::vector v; + int i = 0; + for (; i != 100000; ++i){ + v.push_back(i); + } + //std::priority_queue pq(v.begin(), v.end()); + TinySTL::priority_queue pq(v.begin(), v.end()); + ProfilerInstance::start(); + for (i = 0; i != 100000; ++i){ + pq.pop(); + } + ProfilerInstance::finish(); + ProfilerInstance::dumpDuringTime(); + +######i = 100000 -> (TinySTL::priority_queue<int>:19ms \\ std::priority_queue<int>:7ms) +######i = 1000000 -> (TinySTL::priority_queue<int>:137ms \\ std::priority_queue<int>:92ms) +######i = 10000000 -> (TinySTL::priority_queue<int>:1532ms \\ std::priority_queue<int>:1214ms)