Live data from Hacker News

A 14kb page can load much faster than a 15kb page (2022)

endtimes.dev

321–324 of 324 posts

Re: A 14kb page can load much faster than a 15kb page (2022)

#321
post #290
post #97

Earlier quoted context omitted.

That’s already how it works. The binary is a compressed artefact and the stream is a TLS pipe. But the principle is the same. In fact videos streams over the web are actually based on how HTTP documents are chunked and retrieved, rather than the other way around.

Thanks for clarifying that. My goal was to question the way we do things. Game streaming, for example, works differently. The game runs entirely on a remote server. The server has a GPU/CPU combo that renders the game in real time and user input is sent back to the server via UDP/WebRTC or a TCP tunnel. Also, native mobile apps work quite differently from both video and game streaming. Bottom line: we've seen some gr…

Almost everything these days is built on top of HTTP simply because it’s easy.

Video streaming is still HTTP and the data is chunked. The reason data is chunked is so that you can have adaptive bitrate. Ie if one chunk takes too long to download then the next chunk will be the same time slice but at a lower bitrate. All served over HTTP.

HTTP itself has evolved massively over the years too. HTTP3 is actually a binary protocol built on top of UDP.

You’ve got the right attitude questioning why things are. But you’re also not alone. Which is why modern HTTP doesn’t look anything like its 90s predecessor and why so many public facing systems have adopted HTTP.

You do see proprietary video streaming protocols too. But the reason they’re not generally used for public-facing services is the same reason HTTP is everywhere: firewalls and routers work fine with HTTP because HTTP is ubiquitous. Whereas proprietary formats, and particularly ones based on UDP, don’t always play nicely with routers and firewalls.

In fact UDP in particular is a troublesome datagram for routing.

I’ve worked in the broadcasting sector for a while but it’s been a long long time since I’ve worked in the games industry. So I don’t know what is commonly used for game streaming. But for video streaming, they moved away from proprietary protocols to HTTP. As latency drops and bandwidth increases, I would expect to see the same trend with game streaming too.

Re: A 14kb page can load much faster than a 15kb page (2022)

#322

Earlier quoted context omitted.

Can you live fork containers like you can VMs? VM clone time is surprisingly quick once you stop copying memory, after that it's mostly ejecting the NIC and bringing up the new one.

You mean creating a different container that is exactly equal to the previous one? It's absolutely possible, but I'm not sure there's any tool out there with that command... because why would you? You'll get about the same result as forking a process inside the container.

It's useful if you want to bring up a containerized service, optionally update OS, run tests, and if everything is good, copy that instance a bunch of times rather than starting fresh.

It gets you scale out a batch of VMs remarkably quickly, while leaving the original available for os/patch updates.

If I'm willing to pay the cost of keeping an idle VM around, subsequent launches are probably an order of magnitude faster than docker hello-world.

Re: A 14kb page can load much faster than a 15kb page (2022)

#323
post #165

Earlier quoted context omitted.

If you want to test out some examples from your website to see how they'd look in KaTeX vs. browser MathML rendering, I made a tool for that here: https://mk12.github.io/web-math-demo/

Nice tool! Seems "New Computer Modern" font is the Native MathML rendering that looks closest like standard LaTeX rendering, I guess cause LaTeX uses Computer Modern by default. But I notice extra space around the parenthesis, which annoys me because LaTeX math allows you to be so precise about how wide your spaces (e.g. \, \: \; \!). Is there a way to get the spaces around the parenthesis to be just as wide as stand…

Assuming you’re seeing the same issue as me: I find the parenthesis spacing is messed up whenever there are unnecessary \left and \right, as there are in some of the samples, which leads to an extra in the MathML. If you only use those when they really need to stretch, then it looks much better.

Re: A 14kb page can load much faster than a 15kb page (2022)

#324
post #323

Earlier quoted context omitted.

Nice tool! Seems "New Computer Modern" font is the Native MathML rendering that looks closest like standard LaTeX rendering, I guess cause LaTeX uses Computer Modern by default. But I notice extra space around the parenthesis, which annoys me because LaTeX math allows you to be so precise about how wide your spaces (e.g. \, \: \; \!). Is there a way to get the spaces around the parenthesis to be just as wide as stand…

Assuming you’re seeing the same issue as me: I find the parenthesis spacing is messed up whenever there are unnecessary \left and \right, as there are in some of the samples, which leads to an extra in the MathML. If you only use those when they really need to stretch, then it looks much better.

Thanks, the special \left and \right parenthesis were indeed the culprit.
Post reply on HN