4 ms·
Web apps do not need to be slow, they are slow because they are badly written or more usually rely on the network far too often. There is no reason <Button
by daleharvey 10y ago
Web apps do not need to be slow, they are slow because they are badly written or more usually rely on the network far too often. There is no reason
<Button android:id="@+id/button"
is faster than
<button>
- aikah 10y ago> Web apps do not need to be slow They are slow because HTML rendering engines are slow, they are slow because Javascript engines aren't that fast compared to Java, C or Swift. Native frameworks don't need to deal with the complexity of an HTML layout and CSS. And native applications can be optimized to use way less memory than web apps. There is very little room for performance tuning in a web app, since it depends on the browser engine. Something good for a browser can degrade performances in another browser. > <Button android:id="@+id/button"> Isn't dynamic, it is inflated once and turned in a class instance. > <button> Is highly dynamic as it can be replaced by anything at any time in an HTML page.
- izacus 10y agoThe first one is also precompiled for quick parsing at compile time and doesn't burn battery/CPU every time a user accesses the app.
- daleharvey 10y agoRendering engines are capable of turning html into on screen drawn pixels more than fast enough for the user to perceive and are capable of maintaining 60fps drawing. JavaScript can certainly deal with handling user input faster than the user can perceive, rendering engines can 'inflate' html (cache the layer tree) of dom that hasnt been invalidated. While a commercial failure I worked on Firefox OS and we built an OS and application suite that on low end hardware compared often favorably than the equivalent on Android. The web does not need to be slower than native applications it just needs to be built better
- qwtel 10y ago> we built an OS and application suite that on low end hardware compared often favorably than the equivalent on Android I haven't heard this before. I assumed firefox os failed because the web stack proved to be too crufty for the low end hardware. Are you aware of any resources that go into more detail?
- daleharvey 10y agoMost of the code and metrics are now outdated but https://wiki.mozilla.org/Firefox_OS/Performance https://wiki.mozilla.org/Firefox_OS/Performance will have some historical perspective, http://eideticker.mozilla.org/#/android/lg-g2x/mozilla-central/clock/fps/0 http://eideticker.mozilla.org/#/android/lg-g2x/mozilla-centr... was our test for comparison between android and fxos. When we started it was an open question whether we could build a fast enough platform to compete with native applications, thats no longer a question I think about. People think the web is slow because opening facebook.com takes >200 requests loading >4MB over the network of which a large chunk blocks any rendering (and all of which interferes with it). Build a web application which loads its UI from disk, caches application data, only touches the network for updates, does not block rendering waiting on bundles of JavaScript and uses proper practices for JS / dom manipulation (use transforms over animating top/left, dont attach process heavy scroll handlers) and your web app will be as fast as a native app
- z3t4 10y agoI think the problem is that web apps is new and we are still experimenting, but new developers, and there are a lot of them, now start with learning a framework, that compiles to another framework that compiles to a framework that complies to JavaScript and HTML. I think we need to take some steps back, and try writing plain old HTML, CSS and JavaScript and also teach new developers how to do so.
- aikah 10y agoThat's a lot of do this/do that. With native apps you get all that for free with no effort and there is always a lot of room for optimization. The web on the other hand is hostile to apps.