Re: loops & perfomace
- Posted by Euman <euman at bellsouth.net> Apr 28, 2001
- 378 views
This is a multi-part message in MIME format. ------=_NextPart_000_0024_01C0CFF0.02A2D3A0 charset="iso-8859-2" It also states in the Euphoria performance docs to save values where you can I did a test of length( ) and found that if I got the length of a sequence OUTSIDE the loop first that this was the faster method... Euman ----- Original Message ----- From: martin.stachon at worldonline.cz To: EUforum Sent: Saturday, April 28, 2001 05:01 Subject: loops & perfomace Hi, i've got an performace question. We've got a loop for i=1 to length(s) do ... end for is length(s) evaluated every time loop is done? So would be in Euphoria faster l= length(s) for i=1 to l do ... end for as i read in one C book? ---------------------------------------- ------=_NextPart_000_0024_01C0CFF0.02A2D3A0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-2"> <META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>It also states in the Euphoria = performance docs to=20 save values where you can</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I did a test of length( ) and found = that if I got=20 the length of a sequence</FONT></DIV> <DIV><FONT face=3DArial size=3D2>OUTSIDE the loop first that this was = the faster=20 method...</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV>Euman</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: = black"><B>From:</B>=20 <A title=3Dmartin.stachon at worldonline.cz=20 = href=3D"mailto:martin.stachon at worldonline.cz">martin.stachon at worldonline.= cz</A>=20 </DIV> <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A = title=3DEUforum at topica.com=20 href=3D"mailto:EUforum at topica.com">EUforum</A> </DIV> <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Saturday, April 28, 2001=20 05:01</DIV> <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> loops & = perfomace</DIV> </PRE><PRE>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Need a better decision-making tool to research, evaluate and select software for enterprise applications or manufacturing point solutions? Masg.com is where you'll find help. <A = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</PRE> <DIV><FONT face=3D"Arial CE" size=3D2>Hi,</FONT></DIV> <DIV><FONT face=3D"Arial CE" size=3D2>i've got an performace question. = We've got a=20 loop</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DCourier size=3D2>for i=3D1 to length(s) = do</FONT></DIV> <DIV><FONT face=3DCourier=20 size=3D2> ...</FONT></DIV> <DIV><FONT face=3DCourier size=3D2>end for</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Arial CE" size=3D2>is length(s) evaluated every = time loop is=20 done? So would be in Euphoria faster</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DCourier size=3D2>l=3D length(s)</FONT></DIV> <DIV><FONT face=3DCourier size=3D2>for i=3D1 to l do</FONT></DIV> <DIV><FONT face=3DCourier size=3D2> ...</FONT></DIV> <DIV><FONT face=3DCourier size=3D2>end for</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3D"Arial CE" size=3D2>as i read in one C = book?</FONT></DIV> <DIV> </DIV> Window? Not=20 yet. First, check our technology forum for help. <A=20 = = href=3D"http://topica.com/u/?b1dd66.b2lJ88">http://topica.com/u/?b1dd66.b= 2lJ88</A> Or send an email To: EUforum-unsubscribe at topica.com This email was sent to: euman at bellsouth.net <A = =3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= ------=_NextPart_000_0024_01C0CFF0.02A2D3A0--