C switch statement efficiency

MQ V8 introduced a header file, cmqstrc.h, that maps constants in the MQI to string values. I’ve mentioned it a few times recently, both here and in some other forums. One question came in, asking about how well that code worked. So I’ve recreated some tests I wrote back in 2015, to demonstrate what compilers do with that pattern. This shows the efficiency of writing large switch statements in C.

Continue reading “C switch statement efficiency”

This post was last updated on February 25th, 2022 at 10:03 am