Since Doom renders the image with vertical columns of pixels (floor, lower wall, portal if exists continues rendering the other sector, then upper wall then ceiling) and since browsers are very good at drawing the sprites out of larger textures... You could send vertical divs shaded with the sector light level and picking the correct textures. Instead of hundreds per column you will have like 5 divs on average per column and they will be textured shaded and scaled by the browser?
I believe he stated in the beginning pretty clearly that the point of this exercise was to stress test the Liveview performance.<p>Making this more efficient would be kinda counter productive
I agree, but it certainly wasn't performant (in the video).<p>I'd be curious to see what parameters are required for a smooth / playable demo.<p>Or am I missing something?<p>(Slow input with no interpolation?)
I think the proposal here is to optimize for bandwidth by minimizing number of divs, because there are fewer divs per column per frame. It might actually turn out to be more work for the browser because it has to layout the columns with divs that are not uniformly sized.
That is!
IIRC someone did exactly that around 15 years ago, a game renderer using div strips, first with Wolfenstein and then Doom. It may have been "Jacob Seidelin" who was very active experimenting with early HTML5 tech, but I've lost all links or they've vanished from the web - I only keep two screenshots I used in a lecture back then.
At that point just run the browser on the server and use proper cloud gaming tech to stream the screen and have low-latency interactivity.
Wonder if it would be more efficient to use a single-pixel column and then draw the colours with gradient stops?
Very impressive! Worth noting that HTMX also has a WebSocket extension - <a href="https://v1.htmx.org/extensions/web-sockets/" rel="nofollow">https://v1.htmx.org/extensions/web-sockets/</a> so one could potentially also do "live views" in more performant runtimes like JVM or Node.js
This is more like HTMX+websockets than phoenix liveview.<p><pre><code> - It's not stateful
- There's no html diffing
- Handlers return target+fragment instead of updating state</code></pre>
Tangential question: is it common for frameworks to use the same name as a package from another framework? I had never heard of Django LiveView, but have used Phoenix’s Liveview and assumed that’s what it was. Not sure if I like that? I.e. does it imply some sort of endorsement or partnership? I do like that Laravel went with Livewire to distinguish it.
So SSR is 50ms and LiveView is 10ms, what test was being performed to achieve these timings? Rendering a sample page or rendering doom?<p>Also LiveView is described as "Build rich, dynamic user experiences with server-rendered HTML without writing a single line of JavaScript." and their example uses django templating to render the HTML that is returned.<p>So what are we really measuring here? The speed up seems to solely come from WebSockets, and maybe skipping some Django middleware. Anyone care to elaborate?
I assume Django LiveView is directly inspired by Phoenix LiveView. It's essentially diffing template expansion on the backend and sending patches to the frontend via websockets where JS then applies the patches. Clicks and other interactions are also transmitted to the backend where state for the socket is updated and the template is reevaluated, hence completing the loop.
In the blog post it uses "600,000 divs/second!" and "10,000 divs using its template engine" while the heading uses 600.000.<p>I assume the difference in usage of full stop / period or comma is accidental?
That is beautifully ridiculous! Thank you for doing that and sharing.
It definitely isn’t running at 60 fps in the video. Is this css performance or something? Or this not really running as fast as it’s stated?
if only i could run django on cloudflare workers<p>guess i could run it on a dedicated server<p>would be nice if we can get django and liveview working without a server
I wish we could host Django apps with the tasks and everything on Cloudflare workers. Also it would be nice to have a DB like SQLite within Cloudflare.
Bunny has very solid edge runtime if you manage to squeeze it into wasm or “magic containers” so it’s just a pod<p><a href="https://bunny.net/cdn-lp" rel="nofollow">https://bunny.net/cdn-lp</a>
They just announced many improvements to Python workers earlier this month: <a href="https://blog.cloudflare.com/python-workers-advancements/" rel="nofollow">https://blog.cloudflare.com/python-workers-advancements/</a><p><a href="https://github.com/G4brym/django-cf" rel="nofollow">https://github.com/G4brym/django-cf</a> has a template (among other things) to get started<p>Another option is the containers stuff mentioned in sibling comment but it's not so FaaS.
Should be possible with this, no?<p><a href="https://developers.cloudflare.com/containers/" rel="nofollow">https://developers.cloudflare.com/containers/</a>
you can do it on wasmer's workers, their last wasm/python approach is pretty solid (compatibility, performance). it's sad to say, but after 4 years of "beta" Python support on CF workers - it's still ugly. I dunno who was responsible for such a neglect, but even with the last changes - total fiasco
We ran Django on AWS Lambas years ago. Wasn’t fun and caused headaches, but worked
Shame Phoenix LiveView is missing from the comparison
Doesn't this also show that HTML/CSS performance is incredibly good on web browsers these days?
This shows how modern hardware is ridiculously powerful.
> 600.000 divs/segundo<p>Basado
When will people stop doing this and just leave Doom alone?