Hacker Newsnew | past | comments | ask | show | jobs | submit | abhi9u's commentslogin

Author here: i encourage you to check the 60+ other articles there before coming to this conclusion.

Maybe everyone should start writing half sentences mixed with ... to not sound like an AI!


RSS seems to be making a come back. Just a couple of days back saw this post going viral on X about RSS https://x.com/0xglitchbyte/status/1878495012800897229


> saw this post going viral on X about RSS

/irony meter explodes/


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.


Thank you (author here).

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.


Thanks for sharing Bosky.

I think you gave the wrong URL :)

This one talks about how CPython executes a + b: https://codeconfessions.substack.com/p/cpython-dynamic-dispa...


Sorry about that. Most of my posts are open, but I usually put one of these behind the paywall in a month. I opened this one.


Ray Tracing in One Weekend: https://raytracing.github.io/


And for perhaps longer than a weekend: The Ray Tracer Challenge A Test-Driven Guide to Your First 3D Renderer [0]

[0] https://pragprog.com/titles/jbtracer/the-ray-tracer-challeng...


Not sure why, but the title is slightly incorrect.

Actual title is "CPython Internals: What Happens Behind the Scenes When You do a + b?"


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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: