This single line probably wouldn&#39;t be noticeable, but I just get the feeling in general that LT has been slowing down and anything to reduce the memory/cpu overhead would be helpful. <br><br><font size="-1"><span class="a">
<a href="http://ez.no/content/download/134087/853115/version/2/file/ez2006_high_perfromance_">ez.no/content/download/134087/853115/version/2/file/ez2006_high_perfromance_</a><b>php</b>.pdf<br><br>has some information regarding preg_replace vs str_replace... it is also just a really good presentation.
<br></span></font><br>I don&#39;t mean to nit-pick, I was just trying to point something out that perhaps hadn&#39;t been thought about.<br><br>-Matt<br><br><div><span class="gmail_quote">On 2/5/07, <b class="gmail_sendername">
Jon Daley</b> &lt;<a href="mailto:plogworld@jon.limedaley.com">plogworld@jon.limedaley.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I haven&#39;t done any tests with it - how much memory/resources does<br>it use?&nbsp;&nbsp;If it is significant, maybe we should just use str_replace.<br>Oscar - does the string you are searching have a http:// prefix?&nbsp;&nbsp;If so,
<br>we could use str_replace, but search for &quot;<a href="http://www">http://www</a>.&quot; instead of just<br>&quot;www.&quot;<br><br>On Mon, 5 Feb 2007, Matt Wood wrote:<br>&gt; ugh. I&#39;m an iddiot. Reading top down or something.
<br>&gt;<br>&gt; On 2/5/07, Matt Wood &lt;<a href="mailto:matt@woodzy.com">matt@woodzy.com</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; preg_replace take significantly more time (and memory) to execute than<br>&gt;&gt; str_replace... just wondering what your rationale for this was...
<br>&gt;&gt;<br>&gt;&gt; From PHP Website:<br>&gt;&gt; mixed *str_replace* ( mixed search, mixed replace, mixed subject [, int<br>&gt;&gt; &amp;count] )<br>&gt;&gt; This function returns a string or an array with all occurrences of *search
<br>&gt;&gt; * in *subject* replaced with the given *replace* value. If you don&#39;t need<br>&gt;&gt; fancy replacing rules (like regular expressions), you should always use<br>&gt;&gt; this<br>&gt;&gt; function instead of
<br>&gt;&gt; ereg_replace()&lt;<a href="http://hu.php.net/manual/en/function.ereg-replace.php">http://hu.php.net/manual/en/function.ereg-replace.php</a>&gt;or<br>&gt;&gt; preg_replace() &lt;<a href="http://hu.php.net/manual/en/function.preg-replace.php">
http://hu.php.net/manual/en/function.preg-replace.php</a>&gt;.<br>&gt;&gt;<br>&gt;&gt; On 2/5/07, <a href="mailto:oscar@devel.lifetype.net">oscar@devel.lifetype.net</a> &lt;<a href="mailto:oscar@devel.lifetype.net">oscar@devel.lifetype.net
</a>&gt; wrote:<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Author: oscar<br>&gt;&gt; &gt; Date: 2007-02-05 17:15:16 -0500 (Mon, 05 Feb 2007)<br>&gt;&gt; &gt; New Revision: 4693<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Modified:<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;plog/branches/lifetype-
1.2<br>&gt;&gt; &gt; /class/net/http/session/sessionmanager.class.php<br>&gt;&gt; &gt; Log:<br>&gt;&gt; &gt; Added Jon&#39;s fix<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; Modified: plog/branches/lifetype-1.2<br>&gt;&gt; &gt; /class/net/http/session/sessionmanager.class.php
<br>&gt;&gt; &gt; ===================================================================<br>&gt;&gt; &gt; ---<br>&gt;&gt; plog/branches/lifetype-1.2/class/net/http/session/sessionmanager.class.php<br>&gt;&gt; 2007-02-05<br>&gt;&gt; &gt; 21:49:03 UTC (rev 4692)
<br>&gt;&gt; &gt; +++<br>&gt;&gt; plog/branches/lifetype-1.2/class/net/http/session/sessionmanager.class.php<br>&gt;&gt; 2007-02-05<br>&gt;&gt; &gt; 22:15:16 UTC (rev 4693)<br>&gt;&gt; &gt; @@ -104,7 +104,7 @@<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $scriptUrl = HttpVars::getBaseUrl();
<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $url = new Url( $scriptUrl );<br>&gt;&gt; &gt; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $domain = str_replace( &quot;www.&quot;, &quot;.&quot;,<br>&gt;&gt; &gt; $url-&gt;getHost());
<br>&gt;&gt; &gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $domain = preg_replace(&quot;/^www\./&quot;, &quot;.&quot;,<br>&gt;&gt; &gt; $url-&gt;getHost());<br>&gt;&gt; &gt;<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // this won&#39;t work for top level domains and
<br>&gt;&gt; &gt; domains such as<br>&gt;&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // &#39;localhost&#39; or internal domains for obvious<br>&gt;&gt; &gt; security reasons...<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; _______________________________________________
<br>&gt;&gt; &gt; pLog-svn mailing list<br>&gt;&gt; &gt; <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>&gt;&gt; &gt; <a href="http://limedaley.com/mailman/listinfo/plog-svn">http://limedaley.com/mailman/listinfo/plog-svn
</a><br>&gt;&gt; &gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br>--<br>Jon Daley<br><a href="http://jon.limedaley.com/">http://jon.limedaley.com/</a><br><br>I have never met a man so ignorant that<br>I couldn&#39;t learn something from him.
<br>-- Galileo Galilei<br>_______________________________________________<br>pLog-svn mailing list<br><a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br><a href="http://limedaley.com/mailman/listinfo/plog-svn">
http://limedaley.com/mailman/listinfo/plog-svn</a><br></blockquote></div><br>