4 ms·
> There's no technical reason this needs to be true though. yes, yes there is. HTML/JS is a bastard to parse. it takes a fucktonne of resources to actually fig
by KaiserPro 3y ago
> There's no technical reason this needs to be true though.
yes, yes there is. HTML/JS is a bastard to parse. it takes a fucktonne of resources to actually figure out how to render a box. Go and fire up a windows 95 box, with 133mhx of pentium III goodness. THen make a VB6 app that animates boxes/shows images.
Look how fucking fast it can do it (and vb6 wasn't a fast language)
Or, more easily, render a web page on the original raspberry pi-b, try and play video in a browser, do some sort of animation.
It lags like a fucker. Use py-game (you know python with its 50% "what fucking type is this?" tax) and you can run animations at 60fps.
The web is slow, its just moore's law has shielded us from it.
- qgin 3y agoIt's true, but a current version of a native app has minimum OS version requirements that make running on an old phone impossible. If you're just willing to have the same hardware requirements for mobile web, you've got hardware that can render text and images and buttons just fine.
- KaiserPro 3y agoTo render text in a browser, you are looking at a 10x cost in power. to animate anything, you are looking at 100x cost in power. This means that you will drain the battery much much faster than with native. The solution is not using webtools, its making native much more open/portable. you know like java was supposed to be (kinda like how APKs are now. )
- amadeuspagel 3y agoIf you render text in a browser, you have support for selection, translation, links that the user can open either in the same or in a new tab ...
- hmottestad 3y agoAnimations suck up so much resources. I have a PWA where I wanted a pulsating button with a frosted glass effect. I had to remove it cause it was using 20% of a single CPU core. After removing it the app is only using 6%, just sitting idle, which is about 6% more than any other native app on my Mac.
- wkat4242 3y agoYou can bake it into a gif so you only have to do the rendering once. But yeah. It sucks
- hmottestad 3y agoCan I achieve the frosted glass effect with a gif? E.g. semi transparent and a blur of the background that are visible through the button.
- masklinn 3y agoNope, gifs only support binary transparency (transparent or opaque). APNG would let you do frosted glass though. And I was expecting to add "but support is dire" but... actually it's not so bad? https://caniuse.com/?search=apng https://caniuse.com/?search=apng says 97%, only browsers with no support are legacy (IE and Opera mini), pretty much all browsers have supported it for years. WebP and AVIF also have animation and alpha channel support, so these are also options. Caveat emptor though, I don't have much experience with animation and alpha on any of these formats, so I don't know how buggy support is.
- catlifeonmars 3y agoYou can generate the gif dynamically. Unless you’re doing a lot of resizing, the one time cost of building the gif will amortize quickly across the total runtime of the animation.
- hmottestad 3y agoThe content beneath the button can scroll up and down. I doubt that it will be worthwhile generating a new gif for every single frame while scrolling.
- amadeuspagel 3y agoYou can do that with the canvas API as well.
- pcwalton 3y ago> HTML/JS is a bastard to parse. Parsing is a tiny fraction of the time that a Web browser spends, and the various native resources are on the same level of complexity. TrueType hinting instructions from the 90s are of a similar complexity to the HTML 5 parsing spec. > Go and fire up a windows 95 box, with 133mhx of pentium III goodness. THen make a VB6 app that animates boxes/shows images. This will easily run at the same framerate on a modern Web rendering stack. > Or, more easily, render a web page on the original raspberry pi-b, try and play video in a browser, do some sort of animation. Browsers on the Raspberry Pi B weren't accelerated, due to various reasons including Broadcom having (at the time) the worst GPU driver situation imaginable. You should compare against modern accelerated browsers (by "modern" meaning "within the last 20 years on mainstream OS's"). > It lags like a fucker. Use py-game (you know python with its 50% "what fucking type is this?" tax) and you can run animations at 60fps. Web apps have been able to run animations at 60 FPS for decades. (As an aside, the performance difference between CPython and native code is far more than 50%.)