I think most of the optimizations were pretty low level and had nothing to do with Java itself. You could implement the same techniques in any other (compiled) language and get similar performance results. Things like cache locality, ILP, work stealing, multithreading, SWAR etc. In fact, the top solutions mostly used unsafe to use off-heap memory to avoid GC and copying of data.
In this particular instance Unsafe was used to skip boundary checks. The main difference between the fastest safe version and the fastest unsafe version was how the file was read. The safe version used MappedByteBuffer to read the file, which under the hood memory maps the file and enforces boundaries. The unsafe version memory mapped the file and then read the memory directly using Unsafe.
The fastest version also used Graal which would've helped with startup time.
Yes, the default function argument values is another surprising behavior.
In this case, the default arguments get compiled as part of the function code and are part of the function's environment. As a result every time that function is called it is always having the same environment, i.e. the default argument values are not reinterpreted on every invocation. So the mutations to the environment are visible across function calls.
> In this case, the default arguments get compiled as part of the function code and are part of the function's environment.
Yeah, I understand that; I'm saying that was a choice they made, and I think having the defaults be evaluated at each call time would have been a better choice.
I have not looked into list comprehensions. I think that and how generators work internally might be interesting to write about. I will try to cover them.
Not really, you have an option to exclude your content from being indexed by Google (robots.txt).
I don't care as much about Google losing money because of ad-blockers, they have plenty of money going around. The real people losing here are the ones who are creating the content. As it is they need to amass a large number of views to earn few dollars from a video. Depending on the type of content, a lot of time, money and effort goes into creating each of those videos.
Maybe everyone should start writing half sentences mixed with ... to not sound like an AI!