mb_check_encoding slow performance?

From: Date: Sat, 07 Aug 2021 17:57:08 +0000
Subject: mb_check_encoding slow performance?
Groups: php.internals 
Request: Send a blank email to internals+get-115655@lists.php.net to get a copy of this message
not sure if this message belongs on php-general@lists.php.net or internals@lists.php.net or elsewhere, i'll just try here first and see what happens, recently made some tests to check performance of UTF8 validators, and in that (simple non-comprehensive) test, preg_match() is ~33 times faster than mb_check_encoding(), and mb_check_encoding() is less than half the speed of iconv() (even though iconv isn't designed for validating at all, and makes a full copy of the string), can someone shed some light on this? why does mb_check_encoding seem to be so much slower than the alternatives? benchmark code+results is here https://stackoverflow.com/a/68690757/1067003

« previous php.internals (#115655) next »