测试环境:
CPU:Core i7-3770 3.4GHz
内存:4G
系统:64位 Windows 8.1
IDE:Visual Studio 2013
测试对象:
set,hash_set,unordered_set
map,hash_map,unordered_map
测试代码:
// STL容器性能测试 by Daven172
#include <iostream>
#include <ctime>
#include <windows.h>
#include <set>
#include <map>
#include <hash_set>
#include <hash_map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
const int NUM = 5000000;
void TestSet()
{
LARGE_INTEGER f;
QueryPerformanceFrequency(&f);
int *data = new int[NUM];
for (int i = 0; i < NUM; i++)
data[i] = rand() % NUM;
set<int> int_set;
hash_set<int> int_hash_set;
unordered_set<int> int_unordered_set;
LARGE_INTE

本文在Core i7-3770 3.4GHz CPU, 4GB内存的Windows 8.1系统上,使用Visual Studio 2013 IDE,对C++ STL容器set, hash_set, unordered_set, map, hash_map, unordered_map进行了性能测试,详细展示了测试代码和得出的结果。"
128458292,16800769,Node.js+Vue 心理咨询预约系统设计与实现,"['前端开发', 'Vue.js', 'Node.js', '数据库管理', 'Web应用']
最低0.47元/天 解锁文章
1588

被折叠的 条评论
为什么被折叠?



