![]() The code was executed on a PC with Intel i7-4790, 3.6GHz processor, 16GB RAM. I am presenting results for both compilers. Then I tested in GCC 11.2 with C++17 and the results were not so pronounced. General ObservationĪt first, I tested devector in Visual C++ 2022 and saw major advantage in using devector. I have included my own implementation, which I call DeVector, where both insertion and deletion are balanced. Unfortunately, in the Boost implementation ( Boost devector), the insertion is not balanced and the benchmarks show it. By using balanced devector, the insertion time into a flat map can be cut by half in comparison with time used by vector. By using balanced insertion, we will cut the time by half! If a devector used to create a flat map, which contains "key-value" pairs as elements and binary search is used to find the right element. Imagine if a devector is build using random insertion of elements. In Figure 3, the basic idea of balanced insertion is illustrated.įigure 3. If it is in the middle, either option will do. If it is closer to the beginning, then option 2 (backwards). ![]() If it is closer to the end of the data, then option 1 (forward). Which option should be chosen? it depends on the position of the element.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |