Re: [Htmlvalidator-help] patches
Brought to you by:
mgueury
From: [LoN]Kamikaze <LoN...@gm...> - 2006-06-02 01:07:45
|
Marc Gueury wrote: > Hi Dominic, > > I just look the result. It is good in a way is that the line wrapping > works fine. It works > really well for small files. Unhappily, there are also big files. I am > attaching one to this mail. > Adding the line number with your procedure takes 20/30 sec on my pC and > Firefox ask to > stop the script. This is the problem with most algorithm I used for now. > There are too slow. > > This is pity since your code is really well written and would work on > Unix ... > > Marc > The attached file is the multi threaded implementation of my algorithm. To my surprise I get the best results on a single core machine when I spawn 16 parallel threads. I don't know weather it makes sense to double it on a dual core machine, but this could be made tunable in the options. I'd suggest the options 8, 16, 32, 64, 128 and 256. I don't think that more would make sense. Less than 8 is a bad idea, at least on my machine. Now, some changes that I had to make outside of my methods: The method start() is now taking a parameter. This parameter is required to be able to spawn processes with setTimeout that run methods within the object. Thus it has to hold the name of a globally accessible variable that points to the object. That means the lines: oTidyValidate = new TidyValidate(); oTidyValidate.start(); are changed into: oTidyValidate = new TidyValidate(); oTidyValidate.start('oTidyValidate'); I also changed the function tidyValidateHtml() to call my line numbering implementation instead of yours. Unfortunately there are still some problems left. The "Go to line" feature does not work. If line numbers are present this could be achieved simply by jumping to the Nth <li> in the document. Alternatively every line could be equipped with an <a name="lineXXX" /> at the beginning. Another problem is that switching highlighting on or off hides the line numbers. Even removing them and activating them again doesn't fix this. My guess is that the style of the <ol> gets changed (to be found through the attribute sourceList). So this shouldn't be too difficult to fix. I hope this version will stand up to your testing. |