2 ms·
Looks like the C version is probably more than twice as fast compared to the .NET and JDK versions (which are now close)[1]. Someone needs to do the full modern
by npalli 3y ago
Looks like the C version is probably more than twice as fast compared to the .NET and JDK versions (which are now close)[1]. Someone needs to do the full modern hardware treatment (for ex. SIMD) to the C version (perhaps even adding some ASM) to see where we land.
[1] https://github.com/dannyvankooten/1brc https://github.com/dannyvankooten/1brc
- deleted 3y ago[deleted]
- tuwtuwtuwtuw 3y agoThat "char city[32]" looks like a challenge. Lets hope Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is not in the test set.
- npalli 3y agoIs it really a C program if you cannot execute a buffer overflow attack.
- RodgerTheGreat 3y agoThe repo for the original Java-based challenge states that station names will be between 1 and 100 bytes long. In practice, the test data uses shorter names, and the first few bytes of each name happen to be distinct from other names, so you can cut some corners and still arrive at the correct result.
- tuwtuwtuwtuw 3y agoIf the application doesn't have to be implemented according to spec, then I propose we skip reading the file and just hard code the results.