Email or username:

Password:

Forgot your password?
Top-level
Niki Tonsky

@iliazeus you probably count compressed size? But your browser executes uncompressed one

11 comments
iliazeus

@nikitonsky the browser caches and executes compiled bytecode and/or machine code, AFAIK.

You're probably looking for a "CPU time spent on page load" metric. Code size is irrelevant for what you (probably) want to measure.

Niki Tonsky

@iliazeus well, more code takes more time to execute, no?

iliazeus

@nikitonsky more <video> elements _also_ take more time to process, though :)

Your initial "3 MB per video" just sounds a bit like (unintentional) fear-mongering - it's easy to misunderstand it as "the browser downloads that much more data".

And also, I just wanna ask you to consider if the tradeoff you're making here is worth it. Considering the issues I described in a neighboring thread.

iliazeus

@nikitonsky also, if I'm being a pedant, your statement is false :)

while (true){} takes infinitely more time to execute than veryveryverylongname=1, for example

iliazeus

@nikitonsky this exaggerated example might be surprisingly relevant, since the code might just detect it's being loaded more than once, and skip all the initialization steps on subsequent runs. Embedding several videos into a single page is a common use case, after all.

But I've not tested that, so I can't say for sure.

Niki Tonsky

@iliazeus I can see the time it takes to initialize code _every time you scroll past it_ with my naked eye. That’s definitely a sign of a computer doing crazy amount of work

iliazeus

@nikitonsky that's a completely different website

Again, I was talking specifically about YouTube embeds, and how simply changing them all to <video> elements might not reduce the computer's work by that much, while introducing other complications and edge cases along the way.

Niki Tonsky

@iliazeus Yes, that’s the one from the post about JS bloat

Anyways, if Google can’t reduce their embed down from 3 MB (while other people can) and also recommend to use 3rd-party embeds, I don’t trust them no to waste CPU, too

iliazeus replied to Niki

@nikitonsky can you please at least add links to YouTube videos?

As I wrote in a neighboring thread, the <video>s are way too big to comfortably watch on a phone, or with a less-than-ideal connection. And hard to skim through to find a part I'm interested in, because of lack of chapters or a transcript.

(as it turns out, _some_ of the things a YouTube embed does are actually useful, after all :)

iliazeus replied to Niki

@nikitonsky thank you

Sorry if my comments came of as too aggressive btw, I didn't mean that. Still having some difficulty expressing my thoughts correctly, especially in English.

Go Up