1. length ?

------=_NextPart_000_0009_01C0834B.FC1E3D80
        charset="iso-8859-1"

Hello all,

I often have wondered if I use

for x =3D 1 to length(something)

is it actually faster (which I have become accustomed to doing) to save =
the length value first?

like:

len =3D length(something)

for x =3D 1 to len do

It's probably buried in the docs and missed it, so dont
crucify me Jiri....

euman



------=_NextPart_000_0009_01C0834B.FC1E3D80
        charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I often have wondered if I =
use</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>for x =3D 1 to =
length(something)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>is it actually faster (which I have =
become=20
accustomed to doing) to save the length value first?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>like:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>len =3D length(something)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>for x =3D 1 to len do</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It's probably buried in the docs and =
missed it, so=20
dont</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>crucify me Jiri....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>euman</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>

------=_NextPart_000_0009_01C0834B.FC1E3D80--

new topic     » topic index » view message » categorize

2. Re: length ?

------=_NextPart_000_0039_01C0833B.39E9B2E0
        boundary="----=_NextPart_001_003A_01C0833B.39F2DAA0"


------=_NextPart_001_003A_01C0833B.39F2DAA0
        charset="iso-8859-1"

See the attached benchmark program.  On my machine under DOS32 Eu on a =
Win98 machine, saving the length saves about .05 seconds total in =
1000000 tests.  Most user will not find that significant.

-- Mike Nelson
  ----- Original Message -----=20
  From: Euman=20
  To: EUPHORIA at LISTSERV.MUOHIO.EDU=20
  Sent: Saturday, January 20, 2001 10:46 PM
  Subject: length ?


  Hello all,
  =20
  I often have wondered if I use
  =20
  for x =3D 1 to length(something)
  =20
  is it actually faster (which I have become accustomed to doing) to =
save the length value first?
  =20
  like:
  =20
  len =3D length(something)
  =20
  for x =3D 1 to len do
  =20
  It's probably buried in the docs and missed it, so dont
  crucify me Jiri....
  =20
  euman
  =20
  =20

------=_NextPart_001_003A_01C0833B.39F2DAA0
        charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>See the attached benchmark program.&nbsp; On my =
machine under=20
DOS32 Eu on a Win98 machine, saving the length saves about .05 seconds =
total in=20
1000000 tests.&nbsp; Most user will not find that =
significant.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>-- Mike Nelson</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-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 href=3D"mailto:euman at BELLSOUTH.NET" =
title=3Deuman at BELLSOUTH.NET>Euman</A>=20
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  href=3D"mailto:EUPHORIA at LISTSERV.MUOHIO.EDU"=20
  title=3DEUPHORIA at LISTSERV.MUOHIO.EDU>EUPHORIA at LISTSERV.MUOHIO.EDU</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Saturday, January 20, =
2001 10:46=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> length ?</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hello all,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I often have wondered if I =
use</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>for x =3D 1 to =
length(something)</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>is it actually faster (which I have =
become=20
  accustomed to doing) to save the length value first?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>like:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>len =3D =
length(something)</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>for x =3D 1 to len do</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>It's probably buried in the docs and =
missed it,=20
  so dont</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>crucify me Jiri....</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>euman</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial =

------=_NextPart_001_003A_01C0833B.39F2DAA0--

------=_NextPart_000_0039_01C0833B.39E9B2E0
        name="lentest.EX"

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu