note 75513 deleted from function.substr by tularis

From: Date: Mon, 31 Dec 2007 10:48:50 +0000
Subject: note 75513 deleted from function.substr by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134613@lists.php.net to get a copy of this message
Note Submitter: White-Gandalf ---- "substr" seems to be implemented in a sequential way, wasting processing power proportional to the length of the string to be worked on and/or the position of the substring to be extracted. I found a speed increase by a factor of 1000 for string extraction when the original string has a size of about 1 MB, when i replace "substr" by direct access to the chars at their index. "Substr" should not be used for extraction of very small pieces.

« previous php.notes (#134613) next »