From db81d84be4f02aa84a82a48ffe344874b68ed97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Wed, 21 Jan 2015 13:47:47 +0800 Subject: [PATCH] --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6ffae17..a5746b5 100644 --- a/README.md +++ b/README.md @@ -386,15 +386,19 @@ TinySTL TinySTL::Unordered_set ust(10); //std::unordered_set ust(10); - const size_t count = 1000000; + const size_t insert_count = 1000000; + const uint64_t query_count = 100000000; + //calculate total insert time ProfilerInstance::start(); - for (size_t i = 0; i != count; ++i){ + for (size_t i = 0; i != insert_count; ++i){ ust.insert(i);//per insert time } ProfilerInstance::finish(); ProfilerInstance::dumpDuringTime(); + + //calculate total query time ProfilerInstance::start(); - for (size_t i = 0; i != count * 100; ++i){ + for (uint64_t i = 0; i != query_count; ++i){ ust.count(i);//per query time } ProfilerInstance::finish(); @@ -402,9 +406,9 @@ TinySTL |container|quantity|insert time(ms)|query time(ms)| |---------|--------|--------|--------| -|TinySTL::unordered_set<int>|1/100万|8|0| -|TinySTL::unordered_set<int>|10/1000万|139|0| -|TinySTL::unordered_set<int>|100/10000万|1214|0| -|std::unordered_set<int>|1/100万|64|0| -|std::unordered_set<int>|10/1000万|884|0| -|std::unordered_set<int>|100/10000万|2781|0| \ No newline at end of file +|TinySTL::unordered_set<int>|1万/1亿|8|97| +|TinySTL::unordered_set<int>|10万/10亿|139|1000| +|TinySTL::unordered_set<int>|100万/100亿|1214|9546| +|std::unordered_set<int>|1万/1亿|64|101| +|std::unordered_set<int>|10万/10亿|884|953| +|std::unordered_set<int>|100万/100亿|2781|9682| \ No newline at end of file