News for hackers. Stuff that matters.
Re:Deep JavaScript: Theory and Techniques by _bxg1 on Wednesday June 17, 2020 @04:02PM (#23556043)
> And in the browsers, you rarely do heavy processing. If you are, you're doing it wrong - that logic needs to live on the server.

This is very incorrect. At my last company we had a React interface (a specialized IDE, really) that needed to juggle (sort, filter, process) and work with sometimes hundreds of thousands of entities at once, all in-memory. JavaScript did this just fine, and the user experience (and the API design) really benefitted from not having a bunch of extra round-trips to the server.

Even in this extreme use-case, the bottleneck was always the few-hundred items that were actually rendered in the DOM at a time. We virtually never had performance problems from sheer volume of underlying data.

Re:Deep JavaScript: Theory and Techniques by game_the0ry on Wednesday June 17, 2020 @04:44PM (#23556501)
> At my last company we had a React interface (a specialized IDE, really) that needed to juggle (sort, filter, process) and work with sometimes hundreds of thousands of entities at once, all in-memory.

The author's example inserts 4M elements.

> and the user experience (and the API design) really benefitted from not having a bunch of extra round-trips to the server.

Possibly, but unless you benchmarked both scenarios, this might not be the case.

Performance over networked devices often has trade offs, sometimes those trade offs are directly contradictory, eg sorting/filtering/mapping/etc data on client side versus server side via api call - sometimes one is better than the other but you wont wont know unless you benchmark.

I get the impression that your company did not go through that exercise, considering you guys are building an IDE with scripting language.[1]

[1] https://nickjanetakis.com/blog/switching-to-vscode-from-subl....

Re:Deep JavaScript: Theory and Techniques by jorangreef on Wednesday June 17, 2020 @05:34PM (#23557051)
We actually use this to insert 400M elements.

The only reason the example inserts 4M elements was because Set and Object start to become prohibitively slow at some point and crash the process with too many allocations, not to mention the stress on the GC which now has to follow so many pointers.

HashTable performance is a fundamental component of any language.

Re:Deep JavaScript: Theory and Techniques by game_the0ry on Wednesday June 17, 2020 @06:03PM (#23557317)
> HashTable performance is a fundamental component of any language.

Agreed, but why use Node if performance was so critical to your use case? Could this 400M insert logic exist in a separate service that lives outside your Node code base?

Re:Deep JavaScript: Theory and Techniques by _bxg1 on Wednesday June 17, 2020 @06:39PM (#23557643)
It's one thing to write a web service in a different language for performance; it's a much bigger question to move logic from your client to your server for the sake of performance. Both from a user experience standpoint and from an architectural complexity standpoint.
Re:Deep JavaScript: Theory and Techniques by game_the0ry on Tuesday June 23, 2020 @04:39PM (#23619920)
Not sure what you're getting at. Could you elaborate?