Better HN
topnewbestaskshowjobs
Log inSign up

BuzzwordChief

8 karma · joined Oct 13, 2022 (4y ago) · 3 submissions

Submissions

comment 3y ago · link · parent

It is not about the interpreter. You just can't express performant code in these languages.

JIT compilation makes Javascript faster, but it is not by any metric "fast".

comment 3y ago · link · parent

> JavaScript with V8 is one of the fastest interpreted languages.

It is absurdly slow compared to any compiled language.

> Even React isn't all that slow.

Yes, it is.

> I don't know what it is yet (happy to be pointed somewhere) [..]

It is using a web browser to show some text and images.

comment 3y ago · link · parent

> improving the algorithm or eliminating a SELECT N can make a difference of multiple orders of magnitude

Yes and no. The main source of slowness in modern software is memory access (patterns). Yes, a binary search is just O(log(n)) but if your array isn't to big a linear search will probably be faster, just because the chance of your data being in cache is much higher due to prefetching.

But it's much harder to plan, program or to refactor software to have a cache friendly memory layout and access pattern. And good luck optimizing your Java, Python, etc. code with respect to memory when even integers are pointers to some data on the heap...