News for hackers. Stuff that matters.
Re:My Node.js is a bit Rusty by xmcqdpt2 on Friday September 08, 2023 @06:59AM (#37432028)
By the way the very same code in Java would absolutely rip through the files with no extra allocations of arrays once the JIT gets seriously involved. A big loop with temporary arrays in it that are used to populate the fields of a record every iteration is HotSpot C2's favourite thing.

Does node not similarly allocate on the stack in hot loops?

Re:My Node.js is a bit Rusty by pkolaczk on Friday September 08, 2023 @07:41AM (#37432262)
Did you actually test it? Some time ago someone at another forum made a similar claim that returning an Optional from a method in Java will be surely optimized as we well, but it turned out that it wasn't (https://pkolaczk.github.io/overhead-of-optional/).
Re:My Node.js is a bit Rusty by xmcqdpt2 on Friday September 08, 2023 @07:42PM (#37440668)
Good point, I should probably check.