Re: Proposal for a new extension BBCode Parser
| From: | Xavier De Cock | Date: | Fri, 09 Feb 2007 02:33:55 +0000 |
| Subject: | Re: Proposal for a new extension BBCode Parser | ||
| References: | 1 2 3 4 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-4491@lists.php.net to get a copy of this message | ||
Hi Pierre,
Le vendredi 09 février 2007 à 01:42 +0100, Pierre a écrit :
> Hi Xavier,
>
> By the way, you may bench it using bigger data or large loops, the
> time is really small, hard to get the real gain out of the noise.
>
For the bench I've made a typo using $toparse in place of $to_parse i
attach with this mail the corrected times. They are betters and show
more linear evolution of time (for the bbcode extension) versus
exponential time for preg_replace. (sorry for the "bad" numbers)
> About your package, if you need help to create a package, let me know.
> It is required to release it through pecl.php.net.
>
For making the package is there any url where we can find
documentation / Howto or other information?
> Thanks for your contribution!
>
Thanks for your time.
------------ Corrected Numbers for the benchmark ------------
REM: I have 2Mo level2 Cache on my CPU
== Test on 10 byte text ==
Preg_replace-Time [9 elements] : 2.5033950805664E-05 s
BBCode-Time [35 elements] : 1.215934753418E-05 s
== Test on 100 byte text ==
Preg_replace-Time : 8.2969665527344E-05 s
BBCode-Time : 3.0040740966797E-05 s
== Test on 1 000 byte text ==
Preg_replace-Time : 0.00035190582275391 s
BBCode-Time : 0.00034379959106445 s
== Test on 10 000 byte text ==
Preg_replace-Time : 0.0080559253692627 s
BBcode-Time : 0.0047910213470459 s
== Test on 100 000 byte text ==
Preg_replace-Time : 0.28816604614258 s
BBcode-Time : 0.032165050506592 s
== Test on 200 000 byte text ==
Preg_replace-Time : 1.1172230243683 s
BBcode-Time With Init : 0.070307016372681 s
== Test on 500 000 byte text ==
Preg_replace-Time : 6.3259580135345 s
BBcode-Time : 0.21532392501831 s
== Test on 1 000 000 byte text ==
Preg_replace-Time : 25.815299987793 s
BBCode-Time : 0.58087205886841 s
== Test on 2000000 byte text ==
Preg_replace-Time : 101.28245615959 s
BBcode-Time : 1.8990969657898 s
== Test on 5 000 000 byte text ==
Preg_replace-Time : 636.39691495895 s
BBcode-Time : 10.865201950073 s
== Test on 10 000 000 byte text ==
Preg_replace-Time : Over 15 min
BBCode-Time : 41.858170986176 s