How would you make this switch statement as fast as possible?

后端 未结 21 2045
别那么骄傲
别那么骄傲 2021-01-30 04:17

2009-12-04 UPDATE: For profiling results on a number of the suggestions posted here, see below!


The Question

Consider the following very

21条回答
  •  一整个雨季
    2021-01-30 04:44

    You can get a mild speed-up by ordering the codes according to which ones are most used.

    But I agree with Cletus: the best speed-up I can think of would be to use a hash map with plenty of room (so that there are no collisions.)

提交回复
热议问题