Justin Blank (@hyperpape) header
Justin Blank (@hyperpape) profile picture

Give me the natural numbers or give me death. Also [email protected] and https://teapawt.org/t.co/34DIwnSHZB

Caldas da Rainha, Portugal
Joined March 2008
Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)Photo by Justin Blank (@hyperpape)
Justin Blank retweeted
A major Indonesian bank moved from Java to Rust and saw 486x boost in memory efficiency… bruh
51
1,313
49
18,734
768,271
Spot a benchmark bug:
21
2
33
15,399
Justin Blank retweeted
30 Years of Notebooks bactra.org/weblog/30-years-o…
8
8
58
20,054
Do no work. (fail fast) Do less work. (Algorithmic optimisation) Do work in parallel. (Parallelism) Do work before the actual work. (Pre processing) Do work only once. (Idempotence) Do work with previous results. (Caching) Do work with less. (Compression) Do work when required. (Lazy loading) Do work without contention. (Lock free) Do work near the data. (Locality) Do work adaptively. (Auto Scaling) It’s all about “doing work the right way” to design and implement - high performance, cost-effective and highly reliable systems.
1
18
104
7,645
Justin Blank retweeted
It is super interesting that the popular "numbers every programmer should know" tables do not show latency distributions. Evan Jones was thinking the same thing in 2021 and worked out network latency distributions. evanjones.ca/network-latenci…
5
13
184
11,955
Justin Blank retweeted
Actually, to be really pedantic, the thing to hateses is *deserialization*. Serialization "merely" leaks private data; deserialization enables actual integrity failures, and undermines lots of useful optimizations.
5
3
31
4,449
Justin Blank retweeted
Happy to announce a release of miniTSis, my property testing library for TypeScript
1
3
7
577
Justin Blank retweeted
The fast JavaScript runtime Bun is much faster than Node.js 22 at decoding Base64 inputs. By much faster, I mean *several times* faster. But they both rely on the same underlying library (simdutf) for the actual decoding. So what gives? The problem is that Node.js needs to interact with v8, the underlying JavaScript engine (from Google)... and doing so is not trivial. Before we can start decoding the string, we need to grab the string... so, in this instance, we call String::Value... In turns, this allocates an array inside Node.js and asks v8 to copy the content to it... In an ideal world, we would avoid the trouble entirely and just ask v8 to give us direct access to how it stores the string... and we try to do that if we can... but let me come back to it... How bad can this be, right? Just a copy. Well. Let us do some profiling... So you see, the base64 decoding itself is about about 1/5 of the running time, but the copy takes half of it. What is up with this CopyChars function? Well, it is mostly just a wrapper around the standard high level C++ function std::copy_n as far as I can tell. (see v8/src/utils/memcopy.h) But we are copying for an 8-bit input to a 16-bit output... why is that? Base64 is pure ASCII... and v8 can store ASCII using 8-bit per character. We get there before both IsExternalOneByte() and IsOneByte() are false (see node/src/node_buffer.cc)... We have fast paths for these cases. If IsExternalOneByte() is true, we just get the bytes and everything is great. Unfortunately, it does not always work. So we have a v8 string that is really pure ASCII, but, seemingly, we can't tell that it is the case from Node.js, and so we have to convert it to UTF-16 needlessly, using a function that is maybe not very well optimized... and then we do the base64 decoding of an ASCII string from the UTF-16 input. It is not great. To be fair, this is just one string, created as 'Buffer.alloc(size, "latin1").toString("base64")', basically the base64 encoded version of the string "latin1latin1latin1...". In actual applications, we might have better luck. Yet. Yet. I am telling this complicated story for a reason. The story illustrates why our software is slower than it should be. We have layers of abstractions to fight against. Sometimes you win, sometimes you lose. These layers are there for a reason, but they are not free. To make matters worse... these abstraction layers often thicken over time... and the friction goes up. To be clear, I do not claim that the Node.js code is optimal. In fact, I know it can be better. But it is not trivial to make it go fast. I sometimes hear people say... "well, it is C++ and C++ is hard". No. The C++ part is easy relatively speaking. The difficulty is at a higher level. It is not a matter of syntax. It is a matter of architecture.
In the next version of Bun `Buffer.from(str, "base64")` gets 6x - 30x faster on large input, thanks to @lemire's simdutf
32
233
35
1,628
557,111
Half of my "performance engineering" job is asking simple follow-up questions, so people are encouraged to look at their reports yet again, and generate more plausible hypotheses by themselves.
4
3
48
2,586
🎉🥳 Lilliput 4-Byte headers - IT’S ALIVE!! 🥳🎉 I can now allocate objects with a bunch of fields (e.g. 4 bytes or 1 int or 1 reference) into a single 64-bit word 😁
9
28
4
114
18,500
As part of an otherwise mostly mediocre session on academic writing that I was required to attend during my PhD-attempt (I subsequently taught a better one) one of thing they said was "English doesn't actually have synonyms" and I think about that a lot.
4
4
2
190
2,772
Me at 25: Tests should be 5ish lines! One assert per test! Me at 40: This test is 56 lines long with 11 asserts. If I broke it up, it would be 11 separate tests, ~5x as much code, multiple helper functions and `beforeEach`s to avoid duplication, and more difficult to read.
16
69
9
1,018
87,231
I do not like the Facts vs Opinions dichotomy and I think people should stop peddling it. In this blog post I link to some detailed objections I find persuasive, and also outline my big picture objection. sootyempiric.blogspot.com/20…
38
62
26
371
87,295
How System.identityHashCode() could work with just 2 hash-bits in the object header. wiki.openjdk.org/display/lil…
6
9
1
37
7,019
Replying to @gunnarmorling
Yes! This regularly trips up folks migrating queries to @MaterializeInc. min() and max() fundamentally require O(n) space to incrementally maintain. It doesn’t help that count(), sum(), and avg() *can* be incrementally maintained in O(1) space.
2
2
20
2,170
I feel like I'm finally starting to turn a corner on data-oriented design and its such a great concept for writing fast software. On the surface its "obvious" but it has taken me awhile to really internalize how to design/refactor software for it. vimeo.com/649009599
10
38
6
479
81,797
Did you see that extremely viral @WSJ chart showing traditional values falling off a cliff? Here's why it's probably wrong: patrickruffini.substack.com/…
23
120
43
419
316,605
Locking is often used in places it isn't required. Fly knows this and is moving away from it. "How to do distributed locking" by @martinkl is the best writing on the subject that I know about. martin.kleppmann.com/2016/02…
2
6
49
9,440
I’m currently looking for a new technical writing job. If you know of anything that might be a good fit for me, or want more information, I’d be interested to hear from you!
1
6
7
2,286
Justin Blank retweeted
UK ONS latest on Long Covid. Good: Total numbers of people self-reporting Long Covid continue to decrease. Bad: Little change for the subset of people who’ve had LC for a long time and are affected a lot. Con: no control group. Pro: great sampling, longitudunal, asks severity.
An estimated 2.0 million people living in private households in the UK (3.0% of the population) were experiencing self-reported long #COVID19 as of 2 January 2023. ➡️ ow.ly/Ucvy50MHyoU
2
14
2
58
59,208