91 points · by ksec · 6y ago · 29 comments
It is the most complicated NP hard problem that ever graced web development and literally stifling our progress on building a drop down box that updates all to other drop down boxes on the page.
Like, obviously your health bar is a separate component. But when your health bar updates, how does the other health bar over your characters head also reflect that change? Just drives me nuts, is there like a variable or something that they both subscribe to?
And if UE5 did solve this, why didn’t they even mention this technical feat in their demo? Web developers have entire conferences when this problem was discovered, but for UE5 to not even bring up this accomplishment makes me wonder, #conspiracy.
The DOM on the other hand is stateful, and is very slow to mutate, which is the core problem of high-level web dev and really not something developers have any control over.
This is not true or at least only deceptively so. If you think about "global state" in a game or more specifically in a rendering scene as "all of the objects in the scene" then the main difference is the lack of acceleration structures for the web. Most of the objects in a scene are never touched because AABB or some other structure allows you to cull large number of objects without ever actually touching them. If objects in the scene change, you definitely need to update those acceleration structures. Fortunately for games, those updates are quick and there are typically not that many of them.
This is why systems like Flutter, despite all their downsides, can be really snappy. They skip the DOM and all its baggage and just use their own "app-first" layout system.
Is it so hard? what gives?
Unpopular option but it's true. Binary protocols are both bandwidth efficient and processor efficient. Back in the day, when a 25 MHz processor and 8 MB RAM was the spec for a powerful UNIX workstation with GUI, stuff like XML and JSON was simply not an option.
Dom is too complicated. We really need a much simpler primitives pipeline optimized for performance.
We need a binary JavaScript. Just parsing it takes a long time.
The other demo that’s really impressive is Microsoft Flight Simulator 2020.
Perhaps there should be a fast alternative to the current web, where the biggest goal is to serve pages with lighting speed. It could be architected from ground up to come with built-in SPA support, that would load the pages in chunks while offering a smooth browsing experience. It could automatically adjust to the device and the network speed of the user, and have all the legacy cruft of the old web removed. So basically like AMP, but without Google's greedy fingers.
Yet the chances of that happening is probably zero, as where's the money in that. A secondary web just for power-users? Hmm, yeah let's see whose going to allocate resources maintaining that.
Edit: I just realised this is a parody website. Fair enough then, this is their editorial line!