Re: A new patch, good efficiency improvements.

"Geoff Air" <[email protected]> Mon, 30 Jan 2006 02:12:47 +1100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Hi Cory,

>>this means the TIDY_USE_MMAP only appears once in the
>>current CVS code, in tidylib.c, around tidyDocParseFile(),
>>and the static removed from initStreamIn() in
>>streamio.c ...
>
>Keeping things in separate files sounds like a good idea.

Attached to a separate email, since emails to the
develop list can not have attachments, is a diff
file, using a single new file fileioW32.c. If this is
suitable to you, I hope you will put it up as a
definitive change ...

It seems the -N option of diff WILL include new files, but
it has a strange way to show it is a NEW file ... it makes
the date of the non-existent cvs file as date zero, like
--- c:/FGCVS/tidy\src\fileioW32.c	Thu Jan 01 01:00:00 1970

This diff patch also includes changes to tidy.dsp, the
MSVC6 build file ... to make building with all versions
of MSVC easy.

>>     doctype = NewNode( doc->lexer );
>>and this would fix this case.
>
>I was not aware of that.  Good catch.

and it contains this 'fix' ... and I have only used
GetFileSize(), but not quite as I originally errantly
wrote it ;=()

Also in pool.c, although you had used the allocation macro,
MemAlloc, you had used 'free' ... now changed to MemFree ...

>>As mentioned, just as a 'test' I have also built Tidy
>>using MSVC6, thus have adjusted the DSW/DSP files
>>accordingly ... I agree with using these as the basis for
>>the WIN32/MSVC port, rather than the new SLN/VCPROJ files ...
>
>Just curious.. why?

Just for backward compatibility ... you can use DSW/DSP with
MSVC7, but can not use SLN/VCPROJ with MSVC6 ... and to add
the SLN/VCPROJ files would mean modifying both for each, and
every change ...

It also includes tidytimer.[c|h] modules, so you can SEE the
speed improvements ... but this would need to be 'fixed'
for *nix platforms ... I do not know their high-performance
timer function(s) ...

It seems your #3 item, (void *) has already been changed in
cvs ;=))

I certainly agree your #1 (file mapping) should default
to on in WIN32, as should the #2 (pool for Node allocation),
and have made it so in the modified platform.h ...

Everybody agrees we should keep the #ifdef in the code
to the barest minimum, and putting this all in a separate
module certainly does this ...

Hope this helps ...

Regards,

Geoff.

PS: Just to remind everyone the (WIN32) benefits of this
patch - run on a 30MB xml file -
Without patch
Parse=9.5066, Out=7.3785, else=0.000066, total 16.89 secs.
Parse=9.5062, Out=6.9299, else=0.000129, total 16.44 secs.
Parse=9.4557, Out=6.7300, else=0.000063, total 16.19 secs.
Parse=9.5349, Out=6.9790, else=0.000063, total 16.51 secs.
Parse=9.6337, Out=6.8220, else=0.000064, total 16.46 secs.
With patch
Parse=5.6912, Out=7.4344, else=0.000061, total 13.13 secs.
Parse=5.6227, Out=6.9251, else=0.000061, total 12.55 secs.
Parse=5.6847, Out=6.6701, else=0.000082, total 12.35 secs.
Parse=5.6951, Out=6.7353, else=0.000062, total 12.43 secs.
Parse=5.6228, Out=6.9983, else=0.000070, total 12.62 secs.

EOF - Tidy-21.doc

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642