Welcome! » Log In » Create A New Profile

Standalone version seems to be >50% faster but has some bugs

Posted by patnaik 
Standalone version seems to be >50% faster but has some bugs
August 09, 2007 11:18AM

Thank you for developing the 'standalone' version of HTMLPurifier. I have compared its performance with that of the regular version (for HTMLPurifier 2.1.1) using an ~65 kb HTML string.

The standalone version gave some fatal errors which however could be fixed by removing the require_once() call for Lexer.php in standalone/HTMLPurifier/Lexer/DOMLex.php, and by removing all require_once() calls in standalone/HTMLPurifier/TokenFactory.php and in all the PHP files of standalone/HTMLPurifier/URIScheme/.

The HTML input was processed in exactly the same way by both versions.

However, using the standalone version was >55% faster: ~1.0 vs ~2.2 s; timed from the require() call for HTMLPurifier to the purification). The time taken for the purification itself was the same: ~1.0 s. Peak memory usage was also the same: ~6.5 MB.

Re: Standalone version seems to be >50% faster but has some bugs
August 09, 2007 09:36PM

Experimental features rear its ugly head! Thanks for the tips, they'll be fixed in the next version.

Thanks for providing this version. It's a lot easier to maintain 1 file and a few files within a folder than 3 files and massive folders.

1 question though. Is it safe to remove the DefinitionCache folder if I don't use it for the cache?

Re: Standalone version seems to be >50% faster but has some bugs
August 27, 2007 04:12PM

Yes, though I really hope you're using some sort of other caching then.

Sorry, you do not have permission to post/reply in this forum.