Re: [SMARTY-DEV] Trouble compiling tpl from resource plugin
| From: | Monte Ohrt | Date: | Tue, 16 Jul 2002 15:43:23 +0000 |
| Subject: | Re: [SMARTY-DEV] Trouble compiling tpl from resource plugin | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-191@lists.php.net to get a copy of this message | ||
better than preg, but still takes 4.7 secs
Jason Sweat wrote:
What about this ? if ($offset=strpos($string,':')) { $offset++; } $match = substr($string,$offset); Well we may have to use urlencode instead of trying to get the filename. preg_match and preg_split are get what we want but are much slower. repeated 100,000 times:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.urlencode(basename($string)); --> 2.920secs preg_match('![^:|/\\\\$]!',$string,$match); --> 7.627 secs explode(':',basename($string)); --> 5.436 secs The second two get it right, but they take much longer. Unless there are any other ideas? Monte __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com