note 48296 added to function.stripos
| From: | drenintell at osu1 dot php dot net | Date: | Sat, 18 Dec 2004 05:07:45 +0000 |
| Subject: | note 48296 added to function.stripos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81961@lists.php.net to get a copy of this message | ||
Something came to my attention that it is worth mentioning here. It seems that striPos is an
expensive function. That is, if you run strPos, say on a 50mb of text 1mb at a time, and run striPos
with the same setup, striPos is about 15 times slower then strPos. Ouch. Performace improves
slightly if you process the above text file 4096 kiloytes at a time. In this case striPos is about
9 times slower.
Of course there are many factors involed that influence the above numbers, including cluster size,
available memory, memory speed, CPU speed etc., however keep in mind that striPos can and it is an
expensive function to use on large files. I will try to rewrite striPos and see if there is a better
and faster implementation and post my findings here. (if any)...here goes nothing.
*drenintell*
----
Manual Page -- http://www.php.net/manual/en/function.stripos.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48296
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48296&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48296&report=yes
Search -- http://master.php.net/manage/user-notes.php