Cost of using std::map with std::string keys vs int keys?

前端 未结 6 1653
礼貌的吻别
礼貌的吻别 2020-12-06 01:43

I know that the individual map queries take a maximum of log(N) time. However I was wondering, I have seen a lot of examples that use strings as map keys. What is the perfor

6条回答
  •  一个人的身影
    2020-12-06 02:06

    Simple example with just accessing values in two maps with equal number of keys - one int keys another strings of the same int values takes 8 times longer with strings.

提交回复
热议问题