DEV Community

Discussion on: 5 (Extreme) Performance Tips in C# 🔥

Collapse
 
kenrogoway profile image
Ken Rogoway

Overall a good article, but the example code has a lot of bugs. So it is hard to know if what is shown was used for your performance tests. If it was then your speed improvements may have more to do with optimizations for invariants. For instance in #3 you add to “counter”, but return the sum of counterA and counterB which are both zero. Similar issue in #4, and it also uses the wrong value for the B portion (you’re using p[0] for both A and B sums.

Some comments have been hidden by the post's author - find out more