Brion Vibber wrote:
Magnus Manske wrote:
Yup, that function's new (didn't see it a
few days ago). Seems the
most time is spent in database queries. Not much to do about that
except caching, which we do. We could collect the links to use one
big query instead of several ones, maybe?
It already collects it into one big query, and most of the time in the
large-page-with-many-links case is spent in a single str_replace() call.
Didn't see your previous mail, or looked at the function very carefully.
I still didn't, so is every occurrence in $string unique? If so, why not use
$this->mBodytext = str_replace( $search, $replace, $this->mBodytext , 1);
(note the ",1"; maybe it should be "count($search)", I'm not
sure)
Thus, if one replacement is shown, it won't have to search the rest of
the string.
Magnus