The ~1MB HTML5 spec: Parser Mem Time ------------------------------ MyHTML 11.3MB 27.7ms parseh(mine) 3.72MB 43.6ms
Mine looks significantly slower, but MyHTML is reading the whole file into memory and processing it in one go whereas I'm doing it in 4KB blocks (much like a real browser would, for incremental rendering). I'm also using 1/3 of the memory, and there is some GUI stuff too --- the crude DOM viewer and renderer is part of this, whereas MyHTML is only the parser with the bare minimal CLI needed to make it parse.
How about something bigger... much bigger?
100MB of HTML: Parser Mem Time ------------------------------ MyHTML 1850MB 32957ms parseh(mine) 540MB 8506ms
This eliminates any startup overhead and shows that even when it's reading 4KB at a time, mine is almost 4x faster and uses 3/10ths of the memory. Cache effects are important here.