Hy all !
Working on a "comunity" version of osclass trying to get more speed and less memory usage refactoring osclass code .
Untill now i've got 30 % less memory usage and 30% more speed
Example refactored code
if( !isset(self::$_purifier) ) {
$_config = \HTMLPurifier_Config::createDefault();
$_config->set('HTML.Allowed', '');
$_config->set('Cache.SerializerPath', osc_uploads_path());
self::$_purifier = new HTMLPurifier($_config);
unset ( $_config); }
Original code same config rebuilded for every purified value even it's the same
}self::$_config = HTMLPurifier_Config::createDefault();
self::$_config->set('HTML.Allowed', '');
self::$_config->set('Cache.SerializerPath', osc_uploads_path());
if( !isset(self::$_purifier) ) {
self::$_purifier = new HTMLPurifier(self::$_config);
}
What's your thoughts for faster osclass and less memory usage ?