[Htmlvalidator-help] multi threaded line numbering - improved
Brought to you by:
mgueury
From: [LoN]Kamikaze <LoN...@gm...> - 2006-06-02 11:33:47
|
I recognized that my algorithm does not recognize nested line breaks. So here is a version that reorganizes the document until all line breaks are direct children of the <pre> tags. I also fixed the line numbering calls to use setTimeout(), to spawn the line numbering in a different thread, so that Firefox keeps reacting while everything is prepared to start the parallel threaded part of the line numbering. Also I removed a bug where lines disappeared when a <pre> only contains a single line, which is the case in about:blank. On my Pentium-M 1300 MHz your lot_of_lines.html takes 32 seconds. That means it does 341 lines per second, which is OK for me, considering the massive amount of parsing and restructuring that is done. |