I have written a profiler for Windows. It’s called ktp until I find a better name (“kerntief profiler”). I want to provide some reasoning for why I have even gone down this path. Some basic facts: It’s a Windows-only command-line profiler for now. It requires zero per-project setup. It supports...
In Unity’s job system, you write jobs as structs like this: struct MyJob : IJob { public void Execute() { // your code here } } One of the restrictions of Unity’s job system is that these job structs must be entirely unmanaged, meaning that you many not put any...
I was recently overcome by the idea of porting some C code of mine to Zig. In the process, I think I learned a thing or two about situations in which Zig is struggling to replace C for me. The short version is: Zig is pleasant until you need lots...
My current sidequest is to improve the codegen for Unity games (and the editor) running on Mono. This post is a continuation of last week’s post about this journey. To LLVM or not to LLVM? As demonstrated last time, Mono’s codegen is often lackluster. The first decision I had to...
My current sidequest is to improve the codegen for Unity games (and the editor) running on Mono. This post and the next two are about this process and what I learned. In this post, I am going to give an example of how code flows through Mono during JIT compilation...
tl;dr: I am tinkering with improved codegen for Mono to get better performance in the Unity Editor and in Unity games that ship with Mono as their runtime. Not done yet, but please do get in touch if your studio is interested in this (mail@s-schoener.com). Unity has for a very...
I am currently on a side quest to write some Zig code, or more specifically: take some C++ code that is written in a I-can’t-believe-it’s-not-C style and turn it into Zig. This entire adventure started with a curiosity for using Zig’s build system. (Verdict so far: I like it!) I...
My friend Stefan Reinalter is asking: I find this extremely worrying, with many of people I respect saying things like “I no longer write code” or “let LLMs do it”. Why did you start programming? Was it never the journey for you, but only the goal? I genuinely want to...
I have spent a lot of time recently on creating a GUI library. I have simply not found a library that satisfies my specific list of (partially subjective) requirements: has a C interface, looks reasonably good by default and allows to create things that actually look good, compiles to WASM,...
Let’s talk about reader-writer locks. Reader-writer locks are what you employ when you know that multiple readers can safely access a resource concurrently, but once there is a single writer that writer will need exclusive access to said resource. In my particular case, there is a C# program which is...
This post is a continuation of my last post about programming with AI agents. I wanted to specifically talk about one property of Claude Code: The constant “Yes, of course!” and “That’s a brilliant idea!” Instead of joining the choir of people that (rightfully) say that a machine that basically...
There are less than 2 weeks left in 2025 and this means it is time to look back at the last year. In last year’s review I ended on this note: For the next year, I hope to spend more timing painting in broad strokes so I get better at...
Edit: There’s a website for cpp2better now! I want to write a few words about what sorts of games benefit from my build postprocessor for Unity il2cpp builds, cpp2better. It’s not the case that every game unconditionally benefits from it to the same extent. cpp2better essentially takes on the role...
A friend recently joked that all my blog posts are to some level just trauma processing. He is not entirely wrong. Today’s trauma is “why does it take 12s to recompile C# when nothing has changed?” I have found no good answers for google-queries like “how do I profile C#...
Edit: There’s a website for cpp2better now! It’s been a while since I last talked about cpp2better. Time for an official “here it is” post. What is cpp2better? cpp2better is a tool that hooks into your build pipeline for Unity to achieve better CPU performance in il2cpp builds. cpp2better achieves...
For a while now, I have been helping along a journey to recover an Instagram account, unsuccessfully. As with so many websites it is an infuriating process of stumbling through a set of pages alternatingly labelled “helpcenter” and “support”, until you realize that their links just go in circles. They...
On Windows, you can’t delete a file while someone else is watching you using it. Or so they say. On Mac or Linux, you can totally delete a file while someone else is using it. This difference has been keeping me busy for a few days. In my concrete scenario,...
I have been unfortunate enough to embark on a journey of C++ cross-compilation, by choice nonetheless. In my case, I use clang to compile on a Linux machine to get binaries for a Windows machine. This is surprisingly approachable nowadays. I do not want to bore you with the details...
Over the past years, I have written async code on Windows with both C++ and C#. Compared to C#, the C++ side is poorly documented, full of landmines, and just generally requires a good bit of experience and caution to handle. For a taste, you can scroll through this piece...
At the risk of alienating almost everyone reading this blog, I wanted to report some first hand experience of interacting with AI for programming. I specifically want to talk about how I accidentally served as a control group for an experiment with an AI agent. Here is the setup: Recently,...