<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/8605" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2004-11-15T14:17:06-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/8605</id>

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-11-15T14:17:06-04:00</updated>

		<published>2004-11-15T14:17:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42785#p42785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42785#p42785"/>
		<title type="html"><![CDATA[string match vs regexp, which is faster?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42785#p42785"><![CDATA[
your repetition count of 1 screws the results, but yes, generally [string match] is always faster than [regexp] since the code it translates to is much more simple and optimized<br><br>more accurate results:<div class="codebox"><p>Code: </p><pre><code>[demond@whitepine demond]$ tclsh8.4% set a blahblah% time {regexp -nocase $a skldjfsdfblah290387423890} 10007 microseconds per iteration% time {string match -nocase *${a}* skldjfsdfblah290387423890} 10002 microseconds per iteration</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Nov 15, 2004 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2004-11-15T13:27:15-04:00</updated>

		<published>2004-11-15T13:27:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42779#p42779</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42779#p42779"/>
		<title type="html"><![CDATA[string match vs regexp, which is faster?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42779#p42779"><![CDATA[
does this sound right to you?<br><br> [11:28]  &lt; Isa &gt;. stringmatching is 25 microseconds per iteration  : Notice<br> [11:28]  &lt; Isa &gt;. regexping is 21721 microseconds per iteration  : Notice<br><br>i thought regexp would be much faster<br><div class="codebox"><p>Code: </p><pre><code>set e "entry"bind pubm -|- * test_speedproc test_speed {nick uhost handle chan text} {  global e  set stringmatch [time {string match -nocase "*$e*" "$text"} 1]  set regexping [time {regexp -nocase {$e} $text} 1]  putquick "NOTICE $nick :stringmatching is $stringmatch"  putquick "NOTICE $nick :regexping is $regexping"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Mon Nov 15, 2004 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-11-15T12:48:38-04:00</updated>

		<published>2004-11-15T12:48:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42777#p42777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42777#p42777"/>
		<title type="html"><![CDATA[Re: string match vs regexp, which is faster?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42777#p42777"><![CDATA[
<blockquote class="uncited"><div>I have no way of testing the speed of these commands.</div></blockquote>yes you have<br><br>it's called <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/time.htm" class="postlink">time</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Nov 15, 2004 12:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dedan]]></name></author>
		<updated>2004-11-15T12:38:48-04:00</updated>

		<published>2004-11-15T12:38:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42776#p42776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42776#p42776"/>
		<title type="html"><![CDATA[string match vs regexp, which is faster?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42776#p42776"><![CDATA[
I have no way of testing the speed of these commands.<br>does anyone have the time and means to test this for me?<br><div class="codebox"><p>Code: </p><pre><code>set e "entry"proc test_speed {text} {  global e  if {[string match -nocase "*$e*" "$text"]} {  if {[regexp -nocase {$e} $text]} {}</code></pre></div>thanks for any help given<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3472">Dedan</a> — Mon Nov 15, 2004 12:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
