|
[Question] Tips on speeding up HTMLPurifier? March 27, 2007 06:42PM |
Registered: 6 years ago Posts: 43 |
Some comments on how different config settings might affect the time taken for processing by HTMLPurifier would be helpful. For example, would processing be faster if Core.EscapeNonASCIICharacters is false, if HTML.AllowedElements is a long list, and so on.
HTMLPurifier is very good but slow compared, for example, to the humbler kses filter. I tested an XHTML string, almost completely valid, of about 3000 characters - with kses, 10 ms, with HTMLPurifier (default config), ~1300 ms.
With caching, slowness may not matter as such, but still...
Edited 1 time(s). Last edit at 04/02/2007 06:40AM by Ambush Commander.
|
Re: Tips on speeding up HTMLPurifier? March 27, 2007 07:01PM |
Admin Registered: 6 years ago Posts: 2,636 |
Hmm, I really don't know! HTML.AllowedElements shouldn't make any difference, Core.EscapeNonASCIICharacters will slow down things however.
Some of the most concrete things you can do to improve speed, you may want to ensure that iconv is installed and you're on PHP5 with DOM.
Any suggestions are patches that speed up the code would be welcome, but HTML Purifier is pretty heavyweight.
HTML Purifier, Standards Compliant HTML Filtering