KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am implementing tbb's concurrent hash map to compare the performance of it against a suite of other concurrent hash tables. However the performance I get out of it is horrendous, I just can't believe it is that slow compared to other concurrent hash tables Here is my implementation of it: class TBB: public TestDs{ typedef tbb::concurrent_hash_map<int,int, HashCompare<int> > hash_t; private: hash_t _ds; public: TBB(const Configuration& config) : _ds(config.initial_count) { } bool containsKey(int key) { hash_t::accessor a; if(_ds.find(a,key)){ return true; } else return false; } int get(int key) { hash_t::accessor a; if(_ds.find(a,key)){ return (int)(a->second); } else return 0; } int put(int key, int value) { return _ds.insert( std::make_pair(key, value) ); } int remove(int key) { return _ds.erase(key); } int size() { return _ds.size(); } const char* name() { return "TBB"; } void print() {} void shutdown() {} }; Does anyone see any issue with my implementation or know of any reason why it may perform slow? It takes over 30 mins for it to insert 200,000 elements in a single thread environment. To put that in perspective, nearly all the other tables perform this test in less than 5 mins. Here is my build code: -w -DNDEBUG -g -msse2 -m32 -DINTEL -D_REENTRANT -lrt -pthread -fno-strict-aliasing -l cds -l tbb -lllalloc UPDATE: I have adjusted my testing code to prefill the hash tables to 1000, instead of 100,000. When running it again, tbb performs 92 op/sec while, another implementation performs 89431 op/sec. (64 thread environment)...Just saying something doesn't seem right.... Additional Info: Computer is a HP
Tags (comma-separated)
Save Edits
Cancel