I tried profiling DDNet with callgrind/valgrind and gprof, and a large amount of time seemed to be spent in Evolve in gameclient.cpp. By optimizing/memoizing the function, the percentage of total cpu time went from 50% to 2% in callgrind (the game would basically just freeze), and a somewhat smaller difference for gprof. (I'm not sure how large the difference will be in practice, and running with a profiler might exaggerate the difference a bit)
This function is called if the client has an...