Live data from Hacker News

Prime Video Uses WebAssembly

amazon.science

191–200 of 254 posts

Re: Prime Video Uses WebAssembly

#191
post #81

Earlier quoted context omitted.

Between electron, webassembly, and other technologies, I don't think the line between web app and native app is as clear as it used to be, especially relative lift and performance. In the end, the only difference may be "one is launched in a browser and one is launched from the start menu"

It is very clear: are ALL controls which could be standard (provided by native OS toolkit) really standard (and respect system theming, customization, etc) and are ALL keyboard shortucts and other behaviors of OS standard toolkit supported? I don't care are code is native (as in compiled ahead of time / just in time / interpreted), but I'm care for behaviors and it consistency, both across one app and whole system. I…

I agree, the controls and OS integration are what makes the most difference in the whole debate. But: Why aren't there native controls in the browser? Why do they suck?

> Even more «native» toolkits, like GTK and QT are have small discrepancies.

And then there is truly native stuff and you still have discrepancies like bugs that make you write your own UI kits, recently witnessed here:

https://nova.app/

> Here's a little editor story for fun. During beta we found some bugs in Apple's text layout engine that we just could not fix. Our solution? Writing our own text layout manager… from scratch.

That is a great example for Panic's dedication and at the same time a sane argument for doing cross-platform development, if you can't even trust the truly native libraries.

Re: Prime Video Uses WebAssembly

#192
post #146

Earlier quoted context omitted.

I can dislike Rust too, but the facts are facts. Emscripten is the leader of WASM world and lot of its code is based on C++.

Emscriptem is targeted at browsers and for that rust does have the target wasm32-unknown-emscripten However, when targeting wasm outside browsers wasm32-wasi is usually a better option.

I already have wasm outside browsers, it is called JVM and CLR bytecode.

> More than 20 programming tools vendors offer some 26 programming languages — including C++, Perl, Python, Java, COBOL, RPG and Haskell — on .NET.

https://news.microsoft.com/2001/10/22/massive-industry-and-d...

Re: Prime Video Uses WebAssembly

#193
post #12

Prime video has unbelievably bad performance on LG WebOS, and it’s not the platform because Hulu, Netflix, Disney, YouTube are all fine. If this is new and makes their app work acceptably, then great! Just checked and Prime using 90MB in my TV, while YouTube uses 214KB, so maybe I already have the wasm monstrosity.

I found most LG WebOS apps to have issues of some kind. A quick Google search tells me that they finally now have an HBO Max app, but that was a major issue for the longest time for me. I got a Google stick instead.

Re: Prime Video Uses WebAssembly

#194
Sounds like they are doing it wrong.

Our Wasm investigations started in August 2020, when we built some prototypes to compare the performance of Wasm VMs and JavaScript VMs in simulations involving the type of work our low-level JavaScript components were doing. In those experiments, code written in Rust and compiled to Wasm was 10 to 25 times as fast as JavaScript.

For video processing, especially high fidelity, high frequency, and high resolution video, I can see WASM crushing JavaScript performance by orders of magnitude. But, that isn’t this. They are just launching an app.

I have verified in my own personal application that I can achieve superior performance and response times in a GUI compared to nearly identical interfaces provided by the OS on the desktop.

There are some caveats though.

First, rendering in the browser is offloaded to the GPU so performance improvements attributed to interfaces in the browser are largely a reflection of proper hardware configurations on new hardware. The better the hardware the better a browser interface can perform compared to a desktop equivalent and I suspect the inverse to also be true.

Second, performance improvements in the browser apply only up to a threshold. In my performance testing on my best hardware that threshold is somewhere between 30000 to 50000 nodes rendered from a single instance. I am not a hardware guy but I suspect this could be due to a combination of JavaScript being single threaded and memory allocation designed for speed in a garbage collected logical VM opposed to allocated for efficiency.

Third, the developers actually have to know what they are doing. This is the most important factor for performance and all the hardware improvements in the world won’t compensate. There are two APIs to render any interface in the browser: canvas and the DOM. Each have different limitations. The primary interface is the DOM which is more memory intense but requires far less from the CPU/GPU, so the DOM can scale to a higher quantity of nodes without breaking a sweat but without cool stuff like animation.

There are only a few ways to modify the DOM. Most performance variations come from reading the DOM. In most cases, but not all, the fastest access comes from the old static methods like getElementById, getElementsByTagName, and getElementsByClassName. Other access approaches are faster only when there is not a static method equivalent, such as querying elements by attribute.

The most common and preferred means of DOM access are querySelectors which are incredibly slow. The performance difference can be as large as 250,000x in Firefox. Modern frameworks tend to make this slower by supplying additional layers of abstraction and unnecessarily executing querySelectors with unnecessary repetition.

Re: Prime Video Uses WebAssembly

#195
post #52

The egui framework they mention is pretty neat: https://emilk.github.io/egui/ It an entirely custom toolkit, so don't expect it to have a native look and feel, but it's a GPU-first design with multiple back-ends. It can be used in native OpenGL apps too. It's an immediate-mode UI, so it's very easy to build and update even complex windows. Great choice if you want to prototype a game.

[deleted]

Re: Prime Video Uses WebAssembly

#196
post #184

Earlier quoted context omitted.

Yes, I really hope this doesn't become common. By not utilising the DOM, you're killing accessibility, autofill, customization (things like reader mode, automatic dark themes...)... These are things that regular people rely on every day (not just us techies writing userscript a and Stylus themes).

I mean I would just argue that the accessibility APIs are currently tied to the DOM and we should fix that.

Accessibility API need a semantic layer that the DOM provide. You can't just make every arbitratry gui accessible. The app developers will have to pay the price (more development time).

Re: Prime Video Uses WebAssembly

#197

Now I know why Prime video app sucks on every iOS device I tried it on, including Apple TV

I've never had a problem with the functionality of Prime Video across any apple/webOS devices. The UI, however, is easily the worst of any streaming platform. Why is a search result returned for each individual season of a TV series? Why doesn't it follow ANY of the Apple TV UI conventions? But somehow it's more reliable than Netflix, Hulu, and HBO Max (hbo isn't that high of a bar though).

Don't forget that every single button in the UI lags.

Start an episode, pause immediately because you just realized you forgot something in the kitchen? Oops now you disabled subtitles because that UI button was still busy popping up (and subtitles are necessary to understand their whispers without being DEAFENED BY LOUD SCENES without adjusting volume by 50% every 2 minutes).

Want to hide the UI because you just finished navigating the menus to re-enable those subtitles and hit the back button? Oops now you go back to the main overview because the first click did register, it just took a minute for the TV to respond and now your second click takes you back. Now have fun scrolling down five rows three columns to find the thing you were watching 1 second ago and do this dance again.

This is not helped by LG shipping a CPU literally slower than a raspberry pi's in a €550 2019 TV, but other apps do not have this problem. It's too bad Prime has some exclusives like The Expanse, I look forward to finishing the couple series we had in the queue and cancelling Prime again.

Re: Prime Video Uses WebAssembly

#198
post #142
post #137

Earlier quoted context omitted.

I cannot believe how Amazon is one of the biggest company on the planet and still cannot seem to figure out UI/UX for any of their product. Amazon (the website) having an awful UX might be "by design" (i.e dark patterns) but it make no sense for Amazon Video, AWS dashboard, the kindle/device side of the Amazon website, ...

Do they even employ UI/UX designers? AWS dashboard doesn't look designed to me.

To be fair, just look what happened to Skype after Microsoft let a designer loose on it: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... They might have wanted to avoid that and just let their devs dump data into screens without a real design.

I'm not a big fan of what some designers deliver, but sitting down with maybe one or two users and seeing how they try to make sense of the mess that is AWS might have made sense.

Re: Prime Video Uses WebAssembly

#199

Earlier quoted context omitted.

You're thinking of React and Flutter and so on. They aren't immediate mode. They're more like retained mode with a non-traditional way of keeping the UI state up to date. Very different to egui.

React and Flutter aren't immediate mode only because they're build on top of the DOM as primitive. Otherwise, conceptually they are evolutions of immediate mode. And they inspired plenty of GUIs outside the web to go "immediate" mode themselves.

Flutter on the web uses the DOM?

I seem to recall discussing here on HN with people from the Flutter team how they didn't use the DOM on purpose.

Re: Prime Video Uses WebAssembly

#200
post #12

Prime video has unbelievably bad performance on LG WebOS, and it’s not the platform because Hulu, Netflix, Disney, YouTube are all fine. If this is new and makes their app work acceptably, then great! Just checked and Prime using 90MB in my TV, while YouTube uses 214KB, so maybe I already have the wasm monstrosity.

[deleted]
Post reply on HN