Comment

Comment by leetcrew

this whole post is kinda confusing to me. I know barely anything about c# under the hood. the only language I've ever used in performance sensitive use cases is c++.

to me, all of the benchmark code looks like an obvious opportunity for dead store elimination. especially this loop in the second round:

  for (var i = 0; i < classes.Count(); i++)
  {
      var x = classes.ElementAt(i).Name;
  }
it doesn't look like any side effects are possible there and x is never referenced outside of the loop. can anyone ELI5 why the compiler generates any code for that snippet?
parent leetcrew 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton