1BRC Dart Single Core #241
HankG
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
@HankG I think we can optimize this further, i have a PR for the same please merge the same if you agree with improvements https://gitlab.com/HankG/1brc/-/merge_requests/1 This implementation completes under 2 seconds (~1.17 seconds) on my machine |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I tried my hand at doing this in Dart, my preferred language. On my machine the standard Java implementation ran in about 2 minutes 14 seconds.
The naive Dart implementation not using immutable objects ran in 6 minutes 50 seconds, or about 300% slower:
https://gitlab.com/HankG/1brc/-/blob/6742515ff1c5702c0534ff2b72f418a2d8adc826/bin/onebrc.dart
The as many stops out as I could think of version runs in 2 minutes 43 seconds, so about 22% slower:
https://gitlab.com/HankG/1brc/-/blob/6742515ff1c5702c0534ff2b72f418a2d8adc826/bin/onebrc.dart
A concurrency example using Dart Isolates I started dabbling with but didn't have anything worth showing for it. The nature of Isolates/Workers model over a more traditional multithreading model makes that more difficult for me to get my head around how I'd get performance out of it.
Beta Was this translation helpful? Give feedback.
All reactions