Earlier quoted context omitted.
will work just fine ;) Another fun trick is using since the spec says to pretend a space is there if not present for whatever reason ( https://html.spec.whatwg.org/multipage/parsing.html#parse-er... )
Cute, but I just ran both your suggestions through the HTML validator at https://validator.w3.org/nu/ and neither of them validated. The first error read "Bad value data: for attribute href on element link: Premature end of URI." The 2nd error read "Missing space before doctype name." Depending on the context these hacks may still be useful, but I personally think that both production sites and code golfing should re…
Making a Website Under 1kB
101–109 of 109 posts
Re: Making a Website Under 1kB
#102Earlier quoted context omitted.
As long as it has more than 8MB, Emacs will do just fine.
I thought it was 80MB and even then you're constantly swapping. (I had 32MB of RAM on the computer I learned Emacs on and it was totally fine.)
Re: Making a Website Under 1kB
#103Earlier quoted context omitted.
I tried that too but decided that saving a few bytes is not worth the parser restarting, so I adhered to strict XHTML for fast page load times.
Not worth the… what? I’m not sure what you’re talking about or thinking of, but I think you’re wrong. Parser restarting is purely when speculative parsing fails , and there’s nothing here that can trigger speculative parsing, or failures in it. If you’re using the HTML parser (e.g. served with content-type text/html), activities like including the html/head/body start and end tags and quoting attribute values will ha…
Re: Making a Website Under 1kB
#104My Wonderful Website
What a wonderful page
Ha! There! 110 bytes. A whopping 914 bytes left for user content.
PS: (I think HN hates code blocks)
Re: Making a Website Under 1kB
#105Earlier quoted context omitted.
Not worth the… what? I’m not sure what you’re talking about or thinking of, but I think you’re wrong. Parser restarting is purely when speculative parsing fails , and there’s nothing here that can trigger speculative parsing, or failures in it. If you’re using the HTML parser (e.g. served with content-type text/html), activities like including the html/head/body start and end tags and quoting attribute values will ha…
So far your theory, but I measured it in practice. Developer tools give easy access to parser events and different page load timings such as parsing stage.
Unless presented with concrete steps to reproduce what you’re talking about, I refuse to believe you.
(Mind you, I’m not denying in this that there are differences, just that they’re even measurable this way on even vaguely plausible documents.)
Re: Making a Website Under 1kB
#106Earlier quoted context omitted.
Not worth the… what? I’m not sure what you’re talking about or thinking of, but I think you’re wrong. Parser restarting is purely when speculative parsing fails , and there’s nothing here that can trigger speculative parsing, or failures in it. If you’re using the HTML parser (e.g. served with content-type text/html), activities like including the html/head/body start and end tags and quoting attribute values will ha…
So far your theory, but I measured it in practice. Developer tools give easy access to parser events and different page load timings such as parsing stage.
Re: Making a Website Under 1kB
#107Earlier quoted context omitted.
will work just fine ;) Another fun trick is using since the spec says to pretend a space is there if not present for whatever reason ( https://html.spec.whatwg.org/multipage/parsing.html#parse-er... )
Cute, but I just ran both your suggestions through the HTML validator at https://validator.w3.org/nu/ and neither of them validated. The first error read "Bad value data: for attribute href on element link: Premature end of URI." The 2nd error read "Missing space before doctype name." Depending on the context these hacks may still be useful, but I personally think that both production sites and code golfing should re…
Re: Making a Website Under 1kB
#108Earlier quoted context omitted.
So far your theory, but I measured it in practice. Developer tools give easy access to parser events and different page load timings such as parsing stage.
FYI: with some super basic benchmarking that repeats an HTML snippet 1–100000 times and times how long setting innerHTML takes, I can report that in Firefox, it’s a little faster to omit , a little faster to omit trailing slashes on void elements, quoting attributes is probably a bit faster, and that the XML parser is much slower (mostly 2–4×). In Chromium, parser performance is way noisier, and I mostly can’t easily…
Re: Making a Website Under 1kB
#109Earlier quoted context omitted.
So far your theory, but I measured it in practice. Developer tools give easy access to parser events and different page load timings such as parsing stage.
The tools you’re talking about are useless for measuring this kind of thing. We’re talking about potential differences well below microseconds, and you’re proposing using tools that (presuming I correctly understand which you mean) report answers in milliseconds, with noise rates of milliseconds (and a lot more if you try scaling it up with things like a million elements in a row). It is possible to benchmark this st…