Updated Comparison of C# and Go Performance

Previous Efforts A couple weeks ago I wrote a post that examined performance of the C# and Go programming languages when parsing large XML documents. Why compare C# and Go? Because the goals of the languages are similar: to provide programmers with a statically typed, compiled syntax paired with a runtime that enforces memory safety and automatic garbage collection (reclaiming memory from unreferenced objects). I compared the performance of my C# code with Go code written by Eli Bendersky in his Faster XML Stream Processing in Go blog post. I concluded my C# code ran slightly faster. Then I made […]

XML Parsing Performance : C# Versus Go

Interest Piqued Recently I read Eli Bendersky’s Faster XML Stream Processing in Go blog post. While the point of his post was to explain the difference between in-memory and stream parsing, then examine various stream parsing techniques in the Go programming language… I got hung up on his choice of language. Update 2019 Aug 17: I’ve run an apples to apples comparison test. See Updated Comparison of C# and Go Performance Go is a new programming language developed at Google. It’s statically typed, compiled, with a runtime that enforces memory safety and automatic garbage collection (reclaiming memory from unreferenced objects). […]

Programming Pearls : Sorting Phone Numbers

Revisiting a Classic Book I’m re-reading Programming Pearls by Jon Bentley. I read this book within a year or two of its release, early in my career. That was 16 or 17 years ago. I remember enjoying it greatly. It opened my eyes to the critical importance of selecting optimal data structures and algorithms when designing solutions to programming problems. The author advocates for deliberation prior to putting hands on the keyboard. Re-reading the book now as a more experienced (and I would hope wiser) programmer, I’m reminded of a quote from Linus Torvalds. What Jon Bentley states in elegant […]

Async Does Not Imply Concurrent

I wish authors who write articles about C# async / await programming techniques would emphasize that two concepts they frequently discuss are actually separate features that provide separate benefits. Perhaps I’ve overlooked an explanation of the orthogonality of async and concurrent in the restaurant or cooking breakfast analogies. (Update 2020 Jul 30: The cooking breakfast article has been updated and draws a clearer distinction between async work and parallel / concurrent work). Nonetheless, it will benefit readers of this blog to disentangle the concepts here. It’s easy for novice programmers to write incorrect code and believe they’re getting performance benefits […]