C vs C#: racing VLC's Gaussian blur

October 12, 2026

Update, October 12: two small source changes bring the line-by-line C# within 8% of the C. Details at the end of Round 1.

In my last post, I showed that a native VLC 4 plugin can be written entirely in C#, thanks to .NET Native AOT. The obvious next question is not how, but how fast. VLC is written in C, video filters touch every pixel of every frame, and C# has a garbage collector. Surely that costs something?

Rather than guess, I picked a real VLC filter, ported it to C# line by line, and raced the two inside the same VLC, on the same frames, with byte-identical output. Then I optimized both and raced them again. Twice.