News for hackers. Stuff that matters.
Re:Tauri Mobile – Develop Mobile Apps with JavaScript and Rust by explaininjs on Wednesday March 01, 2023 @11:59AM (#34984731)
Javascript is plenty fast if you are running a reasonable amount of it, as in: just enough to do what the user wanted. It's slow when you use the popular "DevEx" frameworks that recreate the entire world at the slightest change so that the developers don't need to think too hard.

Consider VS Code, software generally considered to be fast enough: every single interaction is handled by a dedicated, hand written, event handler which wherever possible directly modifies existing DOM nodes with the smallest amount of change possible.

This is miles from React. It's what SolidJS aims to do, but the state of the art here seems to be about equivalent to ASM vs Compiled C in 1980: an expert can get miles better performance by dropping down as far as possible in the stack themselves. Not to mention SolidJS forces you into their "lens" of JS, where variables are functions and functions are auto-invoked at the compilers will. And don't even think about refactoring an expression inside JSX to be outside of it or else you'll break all of reactivity. Unless you wrap it in another function, of course.

Re:Tauri Mobile – Develop Mobile Apps with JavaScript and Rust by nicoburns on Wednesday March 01, 2023 @03:44PM (#34988065)
Even React, despite being much slower than SolidJS, etc is rarely the bottleneck. Slow JS apps tend to be doing stupid things like blocking UI updates on network requests or updating state in such a way that triggers repeated re-renders when only one is required.
Re:Tauri Mobile – Develop Mobile Apps with JavaScript and Rust by explaininjs on Wednesday March 01, 2023 @04:47PM (#34988803)
> updating state in such a way that triggers repeated re-renders when only one is required

OTOH I read that and say it's precisely a React issue/bottleneck :)

Re:Tauri Mobile – Develop Mobile Apps with JavaScript and Rust by nicoburns on Thursday March 02, 2023 @06:31AM (#34994536)
I mean, I think that's kind of fair. It is an issue with React that this can happen. On the other hand, it's pretty much always possible to work around it within React without switching to another framework. So IMO if a team is shipping a React app with performance issues then that's on them.