Bug #70363 [NEW]: why mb_* so slow?
| From: | jhdxr@php.net | Date: | Wed, 26 Aug 2015 16:07:53 +0000 |
| Subject: | Bug #70363 [NEW]: why mb_* so slow? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-195537@lists.php.net to get a copy of this message | ||
From: jhdxr
Operating system: irrelevent
PHP version: 7.0.0RC1
Package: mbstring related
Bug Type: Bug
Bug description:why mb_* so slow?
Description:
------------
It seems mb_* is much slower than the original string related method,
there are lots of data in the user contribution section of the manual
(<http://php.net/mb_strlen>,
<http://php.net/manual/en/function.mb-strtolower.php>).
and today I read
a post talk about this topic (<https://v2ex.com/t/216212>), and the
author use an regular expression instead of mb_*, which is, and to my
surprise, much faster. Here is his code: <https://3v4l.org/d8IAo>. So
i'm wondering why mb_* is so slow. Are the users use them in a wrong
manner, or our implements has some problem?
--
Edit bug report at https://bugs.php.net/bug.php?id=70363&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70363&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70363&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70363&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70363&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70363&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70363&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70363&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70363&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70363&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70363&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70363&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70363&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70363&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70363&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70363&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70363&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70363&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70363&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70363&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70363&r=mysqlcfg