Re: Unicode string iterator performance
| From: | Andrei Zmievski | Date: | Fri, 03 Feb 2006 01:23:51 +0000 |
| Subject: | Re: Unicode string iterator performance | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-21777@lists.php.net to get a copy of this message | ||
Cache it where? In the zval or the opcode? What if the string changes? How do you detect that and invalidate the cached position?
-Andrei
On Feb 2, 2006, at 5:19 PM, Christian Schneider wrote:
You could cache the last position (PHP- and Unicode string index) and start from there. This assumes that most accesses are (more or less) sequential. If you can step backward as well as forward you could use the cached version for both directions but even if you can only go forward it would cover the most common case I guess. Very simple idea but maybe it helps, - Chris