This was a fun challange.
My first attempt using @dart_lang was ~400 seconds, then ~300 seconds, then ~200 seconds.
Using Isolates, I got it down to ~47 seconds.
more details here:
github.com/osaxma/1brc_da…
I managed to get it within 10s for 1BRC, started from 340s. I think apart from reading the file fast, the next most important trick was fast parsing. Thanks to @forked_franz for sharing some amazing pointers.
At this point bottleneck is mostly in the HashMap. But with my
idk why people complain about @dart_lang not having unions...
Dart has something better: "union as a comment"
Here are examples right from the dart sdk repo of how you can use it:
I wonder how they are presenting this AI generated code as Widgets in realtime.
Seeing the `debug` label, I would assume it's just code generation plus hot reload since it's just a presentation.
Tho for a production app, they'd need something fancier (eg @shorebirddev)
This is an interesting one.
So when the analyzer resolves the type of the ternary expression, it tries to find the "least upper bound" in the type poset between the two AppBars, but there isn't a LUB, so Widget is resolved as the type.
More details at: github.com/dart-lang/lang…