
I am a builder by vocation, but my greatest passion is just understanding things, for no practical value.
Joined March 2015
- Tweets988
- Following274
- Followers379
- Likes32.1K
I don't think this ever happened when I was using GPT: I present my coding problem and the route I'm taking, then ask for a specific detail along the route. Claude gets what I'm doing, tells me that's too complex, and here's a better way.
BTW the first attempt didn't work, MediaPlayer wouldn't play the stream. But then Claude calmly changes course, and provides a working example with ExoPlayer!
2
6
368
#1BRC contestants and those who followed it probably know what I mean by "merykitty's magic SWAR". I sat down and tried to explain those awesome 8 lines of code in ~3,000 words of English. Comes with the seal of approval from the man, @quananh1999 !
questdb.io/blog/1brc-merykit…
Remember the Monty Hall Problem? Prompted by this letter, I watched a dozen episodes of Let's Make a Deal. Not a single one of them sported "The Monty Hall Problem"! Contestants were never offered to switch doors.
✨ Friends, Twitter still has some magic left in it. ✨
I tweeted about the Monty Hall Problem yesterday and the daughter of the guy that came up with it follows me on Twitter. She shared this letter that Monty Hall wrote to her dad:
2
668
Interesting bit on #1brc: merrykittyunsafe is the best implementation using the Vector API, and it sits at the throne currently with 2.575. Yet, on the 10k leaderboard, its performance tanks. Why?
The relevant difference is the statistical distribution of the station name lengths: in the official dataset, only 1% are longer than 16 bytes; in the 10k one, 15.5% are longer. In my experiment, I was using vectors in a loop for as long as it took to find the comma, but it was slower than just using SWAR techniques.
merykitty's solution is slower than in my experiment, though. I think it has room for improvement on the 1k dataset: it falls back to byte-for-byte search after the first vector runs out. It could use a loop.
Kind of unexpected, but my little piece of Rust still scores #1 on the 10k #1brc dataset! It's a straight-up solution, all Safe Rust except mmap (which is fundamentally unsafe regardless of language).
github.com/mtopolnik/rust-1b…
I took another test of the top 20 solutions with the full 10k #1brc dataset, these are my measured timings:
thomaswue 8.3
royvanrijn 8.7
mtopolnik 8.9
JamalMulla 10.8
algirdasrascius 13.0
merykittyunsafe 13.8
merykitty 17.8
zerninv 21.2
ricardopieper 22.2
abeobk > 60
asun > 60
iziamos > 60
hundredwatt > 60
These two have invalid output:
artsiomkorzun (probable rounding error)
isolgpus (error at the tens digit)
artsiomkorzun's solution, if fixed, would have the best timing of just 7.4 seconds!
These solutions fail during testing:
yavuztas IndexOutOfBoundsException
ebarlas IllegalArgumentException
obourgain OutOfMemoryError
spullara IllegalArgumentExcepion
jotschi IndexOutOfBoundsException
3
9
1,848
My unofficial #1brc Full Dataset Leaderboard:
1. thomaswue 9.0
2. mtopolnik 9.1
3. royvanrijn 14.3
4. hundredwatt 35.7
5. merykitty 71.7
Honorable mention: artsiomkorzun 7.2, but invalid output. Probably an easy fix away from the podium.
The second battle is heating up!
NB: I only tested the above, there's a good chance some lower-ranked solution would squeeze into 3rd place.
3
4
1,696
For fun and curiosity, I implemented the same #1brc solution in Rust, and in knocks Java out of the park: 5.3 seconds on the same Hetzner CCX33 instance as used for the leaderboard. Just 0.15 branch misses, and 0.02 cache misses per input row!
I've been hacking away in the shadows for #1BRC, got encouraged to submit when I saw the lively back-and-forth that goes on among the contestants on their PRs. Looking forward to some nice convos!
github.com/gunnarmorling/1br…
10
874
Just got across this classic, it was fun to rewatch! It reminded me how much the widespread understanding of AGI improved in the meantime. You won't find many disputes along these lines today.
youtube.com/watch?v=hEUO6pjw…
2
264
History of excuses for not doing your job:
1. lights are out
2. internet is down
3. StackOverflow is down
Right now, ChatGPT is down, and I haven't even checked StackOverflow. My day is done.
2
6
1,094
Here's a cute little gift of the pandemic: public's mistrust of science escalated to a level where politicians can rack up support with claims that the threat to human prosperity isn't global warming, but the transition to clean energy.
teapawt.org/VivekGRamaswamy/status…
The path to TRUTH runs through free speech and open debate. Two years ago, Big Tech censored people who argued that we shouldn’t close schools for Covid. Now they’re censoring me as a presidential candidate for arguing that fossil fuels are required for prosperity. They didn’t censor me because it’s false. They censored me because it’s true.
5
771
From start to finish, the #LK99 saga showed us one thing: the West is massively behind China in basic scientific curiosity and agility. Our labs' top priority is writing yearly reports to secure next-term budgets. The actual science can always wait.
If you're migrating an on-prem monolith app to a microservices-based one on the cloud, you're probably struggling with the problem of lost transactionality and decentralized data. Hazelcast Turbine may be the answer you're looking for. hazelcast.com/turbine/
Hazelcast Jet made it to a billion events per second with millisecond latency! It took 45 nodes on EC2.
jet-start.sh/blog/2021/03/17…
Even a concurrent GC fights your app for the same CPU cores -- except if you're using green threads in a carefully sized thread pool. We used them to boost the throughput of Hazelcast Jet to 40 M items/second combined I+O with 99.99% latency <= 10 ms. jet-start.sh/blog/2020/08/05…
Kotlin coroutines: a production-quality experimental feature everyone should start using today. teapawt.org/relizarov/status/87364…
3
@aphyr Initially, A = 0.
Thread 1, T = 0s: CAS(A, 0, 1)
Thread 2, T = 1s: r1 = A // reads 0
JMM says "OK", but clearly non-linearizable.





