Switch optimization for many cases guarantees equal access time for any case? ( C++ )

前端 未结 6 1304
礼貌的吻别
礼貌的吻别 2020-12-31 19:29

I\'ve seen answers here for specific languages, about switches with more than 5 cases being optimized with jump tables to guarantee constant access time for any case.
Is

6条回答
  •  囚心锁ツ
    2020-12-31 19:57

    For gcc's implementation see:

    http://old.nabble.com/optimization-of-switch-statements-on-i386-to15366926.html#a15367662

提交回复
热议问题