1BRC in .NET #44
Replies: 6 comments 9 replies
-
Amazing! |
Beta Was this translation helpful? Give feedback.
-
Impressive ! Is the call to GetHashCode optimized by the JIT ? |
Beta Was this translation helpful? Give feedback.
-
You may get some more performance by implementing IComparable on Utf8Span so the OrderBy doesn't need to create strings before comparing. You may also trim a small amount of performance by using a StringBuilder when printing the results instead of doing Console.WriteLine and interpolated strings in a loop. There's also AOT compilation, preallocating collection sizes (e.g. the dictionary) if that's not cheating, and tweaking GC settings (such as basically disabling it or using Server GC so it runs much less often). |
Beta Was this translation helpful? Give feedback.
-
Woww amazing! I didn't know anything about named memory mapped files. |
Beta Was this translation helpful? Give feedback.
-
Updated with comparable performance numbers. Now I have a dedicated machine for that. The performance is measured on an idle 6C/12T Alder Lake CPU fixed at 2.5 GHz (no turbo), 32GB DDR4 3200, Debian 12 in LXC. At least 5 runs, showing the best result.
Original numbers were measured inside the app. However, in the latest change I found such a trivial omission that improved the perf by more than |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
.NET 8 version without any dependencies on 6 cores (i5-12500) with ~30GB unused RAM (DDR4-3200 CL22) finishes in
~5.34.25 seconds.This approximately scales to 8.8 seconds on the evaluation server (by comparing local run of the top reported result to the reported time).
No assumptions neither on name nor on temperature format/length/etc. Supports
\r\n
lines endings, since it runs on Windows and the Java generator from this repo uses the OS default new line separator.https://github.com/buybackoff/1brc
Beta Was this translation helpful? Give feedback.
All reactions