Principal Engineer at Microsoft working on .NET runtime.

Warsaw, Poland
Joined November 2010
It's been a year since I started my blog, so I rerun the benchmark on .NET9 RC2 (on the same machine). And it's indeed faster! Today I've got Producer: 961K msg/s (+10%) Consumer: 939K msg/s (+12%) #fsharp #dotnet @apache_pulsar xitter.cf/Lanayx/status/17162686…
2
1
13
1,951
That’s the biggest freaking Tiger Shark i’ve ever seen! 😳
721
6,539
620
70,779
13,666,549
Validating gigabytes of Unicode strings per second… in C#? We have been working on a fast library to validate and transcode Unicode and other formats such as base64 in C++: simdutf. We wondered: could we achieve the same good results in C#? Microsoft’s .NET framework has made great strides in leveraging advanced instructions. For instance, if your processor supports AVX-512, you can instantiate 512-bit registers right in C#! The standard .NET runtime library effectively utilizes these features, demonstrating that they practice what they preach. Most strings on the Internet are Unicode strings stored in UTF-8. When you ingest such strings (from disk or from the network), you need to validate them. To test the waters, we set our eyes on UTF-8 validation. With John Keiser, I helped designed a fast UTF-8 validation algorithm designed for modern-day CPUs. We call the algorithm ‘lookup’. It may require less than one instruction per byte to validate even challenging input. The lookup validation algorithm is part of Oracle Graal, Google Fuchsia, the Node.js and Bun JavaScript runtimes and so forth. The .NET library has its own fast UTF-8 validation function: Utf8Utility.GetPointerToFirstInvalidByte. It is highly optimized. As the name implies, it finds the location of the first byte where an error might occur. It also computes some parameters from which you can tell how the input could be transcoded. The function is an internal function, but we can expose it by copying and pasting it. Could we beat the .NET runtime, at least some of the time? It seems that we can! Maybe you want to know what our code looks like? Here is a simplified example where we load 64 bytes, check whether they are ASCII. Of course, the whole algorithm is more complicated, but not that much more… It is maybe 30 lines of code. We implement various versions of the algorithm, one for ARM processors, one for older x64 processors, and so forth. For benchmarking, we use valid strings. The first one we check is twitter.json, a JSON file that is mostly ASCII with some non-trivial Unicode content within strings. We also use various synthetic strings representative of various languages. On an Intel Ice Lake system, our validation function is up to 13 times faster than the standard library. On twitter.json, we are 2.4 times faster. On an Apple M2 system, our validation function is 1.5 to four times faster than the standard library. Observe how the standard library provides a function that is already quite fast: it can run at gigabytes per second. We are several times faster, but evidently, C# makes it possible to write highly optimized functions. You can run your own benchmarks by grabbing our code from GitHub. It is a pleasure doing this performance-oriented work in C#. It is definitively one of my favorite programming languages right now. cc @tannergooding @EgorBo
9
42
2
285
32,894
Just published an article digging deep into how arrays of doubles are aligned in #dotnet. With juicy bits about the allocation context, fake objects, and C# code that you definitely shouldn't deploy in production. minidump.net/memory-alignmen…
3
22
116
17,637
How it started How it's going
Size of fully self-contained natively-compiled Hello World over the course of .NET 7 previews. This is release build with everything left on default settings, producing a standalone EXE you can just copy to a machine and run. Hello World now under 3 MB by default with PublishAot.
7
26
4
201
95,820
Improving the performance of XxHash3 for ARM with this PR github.com/dotnet/runtime/pu… See! That's a direct benefit from getting this handy dev kit! 😇
Just received this puppy, second fastest ARM64 at home browser.geekbench.com/user/4… below the M1 pro as expected, but for a dev kit, that's pretty good! It will help to optimize stuffs for ARM64 with VS and .NET 7! 😎
2
5
33
1/N One of my favorite optimizations in the upcoming .NET 7 Native AOT is static data preinitialization. This program prints a circle to the screen. Would you believe me if I said there is no code to compute the circle bytes in the NativeAOT'd executable file of this program?👇🧵
6
57
6
238
We are working on verifying assembly output for the JIT using LLVM's FileCheck, JitDisasm, and few other custom things. I feel pretty good about it.
1
39
EgorBo retweeted
ARM adds hinted conditional branches as well as memcpy() and memset() instructions community.arm.com/developer/…
1
7
1
13
Continuing the what's the effect of upgrading to .NET 5.0; since the libraries are "unified" and it's been improved what's the effect on the Mono VM (llvm AoT) On @TFBenchmarks upgrading to Mono to .NET 5.0? x6.4 to x17 times faster! Wow! #dotnet #aspnetcore
11
107
9
335
You can measure the speed of light at home using just a microwave and a bar of chocolate!
319
11,784
1,469
46,562
On @TFBenchmarks upgrading to .NET 5.0 (rc1) (netcoreapp3.1 => net5.0) Middleware is now faster than Platform was, and Platform is now much faster #aspnetcore #dotnet
5
67
4
242
A bit of reading during the containment, just published a new blog post about the development of the native compiler for #starklang xoofx.com/blog/2020/03/21/st… Next remaining one will about the integration with seL4 microkernel. Stay tuned! 🤗
4
6
1
18
A small s**tstorm is heading your way, if you're in the business of running code on Intel computers. Here's a sad story about the state of computing in 2019. It'll take a couple of tweets, but it's actually kind of important (?), so please retweet so this gets proper attention:
12
633
87
1,044