I’ve been playing with C# 15 quite a bit this week, and after yesterday’s post about the new with() syntax I started thinking about something I’ve always struggled with — making code both clean and actually fast.

You know how it goes. You write a quick list, start adding things in a loop, and everything works fine… until your data set grows and suddenly you’re wondering why things feel sluggish. I’ve been guilty of this more times than I care to admit.

So I decided to do a quick experiment.

I created a list with 100,000 items three different ways and timed each one. Nothing fancy, just my laptop and a stopwatch. The results surprised me a little.

Here’s what I tried: