1. Code to optimize.

Here is a small chunk a code to be optimized.
Anyone care to scrutinize(sp) its ineffeciency?(sp)
I am well aware that this code has a lot of speed to be gained.
I just haven't taken the time to tweak it.  I fill this would be a
good simple challange.        HAVE FUN./Happy New Year. 8^)


 temp = {}
  cnt = 0
  while lm > cnt do
    cnt = cnt + lr
    temp = temp & r
  end while
  temp = temp[1..lm]

_________________________

Lucius L. Hilley III    lhilley at cdc.net
http://www.cdc.net/~lhilley
http://www.dragonvet.com
_________________________
<IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">

new topic     » topic index » view message » categorize

2. Re: Code to optimize.

EU>        Here is a small chunk a code to be optimized.
EU>Anyone care to scrutinize(sp) its ineffeciency?(sp)
EU>I am well aware that this code has a lot of speed to be gained.
EU>I just haven't taken the time to tweak it.  I fill this would be a
EU>good simple challange.        HAVE FUN./Happy New Year. 8^)


EU> temp = {}
EU>  cnt = 0
EU>  while lm > cnt do
EU>    cnt = cnt + lr
EU>    temp = temp & r
EU>  end while
EU>  temp = temp[1..lm]

What are lm, lr, and r? If r is just an atom, this would work much
faster:

temp = repeat(r,lm)


EU>_________________________

EU>Lucius L. Hilley III    lhilley at cdc.net
EU>http://www.cdc.net/~lhilley
EU>http://www.dragonvet.com
EU>_________________________
EU><IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

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

3. Re: Code to optimize.

>What are lm, lr, and r? If r is just an atom, this would work much
>faster:
>
>temp = repeat(r,lm)

      Well taken.  I'm am seasoned in Euphoria.  I already know
that.  Simply and Humbly I must say.  I completely failed to
specify what type of data each value is suppose to hold.
I literally YANKED the code directly from the program with out
including my declaration of the variables.

integer lm, lr, cnt
sequence temp, r, my_seq

  r = rand(repeat(255, rand(35))
  my_seq = rand(repeat(255, rand(35))
  lr = length(r)
  lm = length(my_seq)

--lr maybe larger or smaller than lm

  temp = {}
  cnt = 0
  while lm > cnt do
    cnt = cnt + lr
    temp = temp & r
  end while
  temp = temp[1..lm]
_________________________

Lucius L. Hilley III    lhilley at cdc.net
http://www.cdc.net/~lhilley
http://www.dragonvet.com
_________________________
<IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">
_________________________

On Fri, 1 Jan 1999 14:43:14 EST, JJProg at CYBERBURY.NET wrote:

>EU>        Here is a small chunk a code to be optimized.
>EU>Anyone care to scrutinize(sp) its ineffeciency?(sp)
>EU>I am well aware that this code has a lot of speed to be gained.
>EU>I just haven't taken the time to tweak it.  I fill this would be a
>EU>good simple challange.        HAVE FUN./Happy New Year. 8^)
>
>
>EU> temp = {}
>EU>  cnt = 0
>EU>  while lm > cnt do
>EU>    cnt = cnt + lr
>EU>    temp = temp & r
>EU>  end while
>EU>  temp = temp[1..lm]
>
>What are lm, lr, and r? If r is just an atom, this would work much
>faster:
>
>temp = repeat(r,lm)
>
        <SNIP> of my old Signature.
>
>Jeffrey Fielding
>JJProg at cyberbury.net
>http://members.tripod.com/~JJProg/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu