EASTL versus STL, how can there be such a performance difference in std::vector::operator[]

后端 未结 2 987
挽巷
挽巷 2021-02-13 14:03

According to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html vector::operator[] is between 2% and 70% faster in EASTL than a \"comm

相关标签:
2条回答
  • 2021-02-13 14:26

    I think this passage from the documentation will be crucial

    http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html#eastl_allocator

    It is apparently inspired by the famous 'Towards a better allocator model' article by Pablo Halpern

    0 讨论(0)
  • 2021-02-13 14:44

    The document states that they used VC++ 2005 for Windows testing, with which checked iterators are enabled by default (yes, even for release builds; same goes for VC++ 2008). I suspect that the performance of operator[] wouldn't be any different if they added -D_SECURE_SCL=0 to their build command-line.

    0 讨论(0)
提交回复
热议问题