4 ms·
Looking at the DOM in isolation, its pretty quick. The primary reason web apps are slow is because the business logic is typically un-optimized. I've encounter
by Jaygles 5y ago
Looking at the DOM in isolation, its pretty quick. The primary reason web apps are slow is because the business logic is typically un-optimized.
I've encountered a web app that persisted its state by stringifying it and putting it into localStorage with every UI change. The resulting string was ~5MB and took 200-300ms each time (freezing the UI) on my tablet.
I've encountered an app that used an in-house built chart library using jquery and D3. For each chart rendered it created a 50MB array of x-axis labels that wasn't cleaned up when the chart was destroyed.
The reasons for why these inefficiencies exist is another topic. But there's nothing stopping someone from creating a complex web application that's performant.
- sgslo 5y agoEngineers will figure out how to make mistakes like this whether its in the browser or in a native app
- zo1 5y agoPerhaps - but then the question just becomes "which one of those makes it easier for such mistakes to occur".
- MaxBarraclough 5y ago> The primary reason web apps are slow is because the business logic is typically un-optimized. This crops up a lot, shifting the blame from the web technologies to the developers who target those technologies, but where are the exceptions? What's the best example of a large, complex, efficient and responsive web-based application? It's easy to give examples of tragically inefficient and unresponsive web-based applications (Teams, Slack), but no one ever seems able to give a counterexample. Pinboard and Hacker News are fast and efficient precisely because they make minimal 'application-like' use of the web platform. Visual Studio Code is generally pretty responsive, but if I understand correctly there's little question that it uses vastly more computational resources than if it had been built using a 'conventional' (non-web-based) GUI toolkit.
- sethhochberg 5y agoFigma is one of my favorite examples of something which is a nontrivial webapp that avoid feeling like a webapp a lot of the time, even when running in a browser instead of their Electron wrapper. But their technical leadership contains some of the (arguably) most accomplished folks working in the Javascript world these days, they might be an outlier in this area.
- MaxBarraclough 5y agoHow is it on resource-usage though? Another example: Google Docs seems ok on responsiveness, but not on efficiency (especially memory).
- SheinhardtWigCo 5y agoIt’s easy to forget that Figma is a webapp, until you leave it running in the background and your $2000 computer grinds to a halt.
- habryka 5y agoFigma is built in Web-Assembly (compiled from C++) [1] and Canvas, basically sidestepping the vast majority of the web stack. That's why it's fast. [1]: https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/ https://www.figma.com/blog/webassembly-cut-figmas-load-time-...
- p_j_w 5y agoThis exchange is absolutely hilarious to me. We've got people complaining about Google doing something while praising Figma for not being so foolish or evil and extolling them as being exceptionally clever. Except oops, turns out Figma is doing the same thing that is believed to be foolish or evil. It turns out HN is prone to the same sort of knee jerk reactions as most every other "social news" site (even if to a lesser degree). Who would've thought?!
- sethhochberg 5y agoNeat, I had no idea it wasn't a normal old DOM application. Certainly does add a lot of validation to Google's approach here.
- throwaway894345 5y ago> But there's nothing stopping someone from creating a complex web application that's performant. Google--the folks who make V8--seem to disagree with you here. If they find canvas rendering to be more performant, then I'm going to believe them absent more information.