Last week, in my continuing exploration of a C++ Letter Boxed solver, I had to build a faster hash table to improve performance. Today we’ll make it even faster, hoping to catch up to the performance of my .NET Core…
A faster hash table
Last time, I wrote about a native C++ implementation of the Letter Boxed solver. Vexingly, this native implementation was actually slower than the corresponding .NET Core app. Today we’ll try to fix that. As I mentioned, some basic profiling revealed…
Native code: always faster?
Last month, I explored some performance optimizations for a C# Letter Boxed solver. It was a fair bit of effort but in the end I could solve a typical puzzle in ~80 ms. Success! However, you might rightly point out…
A simple message bus
The message bus is a typical pattern to allow loosely coupled software components to communicate, usually in an event-driven manner. Don’t let the enterprise-y description deter you — a simple message bus for a single process scenario can be quite…
A real async GetFiles?
I’ve lamented in the past that there is no real async GetFiles. But that’s okay — we’re problem solvers! Perhaps if we could drop down to the core native API, we could fill in a gap like this. Let’s start…
Refactoring C++: Extract Method using `friend struct This`
My day to day programming environment is C# + Visual Studio + ReSharper. I like to think I’m fairly productive in this setup and after years of experience have picked up a few fast and easy ways to refactor my…
The wait is over: coroutines in C++
Long ago, I wrote about using the PPL to achieve a .NET 4.0 level of parity for async programming in C++. Since then, a lot of work has gone into raising this level of parity to .NET 4.5 and beyond.…
DRY RAII with AutoBuffer
Don’t Repeat Yourself is a good maxim in software design — avoid duplication of information. Today’s sample code will show a small fix to a problem which quite literally involves repeating yourself: those annoying “call twice” Win32 functions like GetVirtualDiskPhysicalPath.…
Find bugs for (almost) free
Want to find bugs in your code for (almost) free? Try static code analysis — a useful technique, though often maligned by developers for noise and “false positives”. If you need an appeal to authority to be convinced, see how…
Introducing overlapped I/O
In Windows, I/O operations such as ReadFile can be performed synchronously or asynchronously. Asynchronous I/O is generally referred to as overlapped I/O since multiple operations can be issued at once and “overlap” in their request lifetimes. There are a few…