From 7723410fe48c0d45529d7d2990f6b03b9aa15f39 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, 3 Dec 2014 11:00:26 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 16d3e17..ccb81ce 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ TinySTL * deque:100% * queue:100% * pair:100% - * list:90% + * list:100% * STL Algorithms: * fill:100% * fill_n:100% @@ -303,3 +303,40 @@ TinySTL |std::list<int>|10万|189| |std::list<int>|100万|1774| |std::list<int>|1000万|17571| + + +####(11):list<int>::sort() + + TinySTL::list list1; + std::list list2; + std::default_random_engine dre; + std::uniform_int_distribution id; + const size_t max = 10000; + for (int i = 0; i != max; ++i){ + auto n = id(dre); + list1.push_back(n); + list2.push_back(n); + } + double cost1 = 0.0, cost2 = 0.0; + for (int i = 0; i != 100; ++i){ + ProfilerInstance::start(); + list1.sort();//TinySTL::list + ProfilerInstance::finish(); + cost1 += ProfilerInstance::millisecond(); + + ProfilerInstance::start(); + list2.sort();//std::list + ProfilerInstance::finish(); + cost2 += ProfilerInstance::millisecond(); + } + cout << "TinySTL time: " << cost1 / 100 << "ms" << endl; + cout << "std time: " << cost2 / 100 << "ms" << endl; + +|container|quantity|time(ms)| +|---------|--------|--------| +|TinySTL::list<int>|1万|0.88| +|TinySTL::list<int>|10万|17.621| +|TinySTL::list<int>|100万|591.354| +|std::list<int>|1万|1.25| +|std::list<int>|10万|35.692| +|std::list<int>|100万|665.128| From 706028c8c8fc81bc908b60ad0a74c377e9d0fe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Mon, 8 Dec 2014 21:56:40 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ccb81ce..8ff9cdf 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ TinySTL * binary search tree * AVL tree * rbtree - * 线段树 + * segment tree * splay tree * rope * Van Emde Boas tree From d6007201e86060a812d3d5f6c7eece68fe488d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Thu, 11 Dec 2014 14:42:39 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8ff9cdf..7105ae9 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ TinySTL * count:100% * count_if:100% * mismatch:100% + * equal:100% * 其他组件: * circular_buffer:100% * bitmap:100%