1. Re: "DISCARD"

---------------------------------------------------
side note:for the listserv, can we use int,obj,seq,
          proc, func & EU???
---------------------------------------------------

Lewis Townsend wrote:
Ralf mentioned:
<snippy snippity snipsnip>
<stuff about discard>
all the examples, code, and discussion has led me to
the belief that any potential speed savings might actually
be nil, or very very close to it.  euphoria already has
some interesting optimizations that i think will kick
in for the following example (rob??)
  obj junk
     junk = graphics_mode(18)
     junk = {}
here i believe EU will see this and optimize... especially
if in a loop.  i've noticed on occassion, in different code,
that "strange" speed boosts appear (kudos rob).  i had
one case where i had a sequence of 500-800 length and had
to pick out a value (presorted, find algorithm).  strangly,
just simply walking the sequence was *damn near* as fast
as a binary search... this isn't a "small" sequence to see
this close of a benchmark... the binary algorithm shoulda
wupped it (like what, 8 comparisons to find my target?
as opposed to 500-800 comparisons). but that loop optimization
and that 'dead' code optimization seemed to kick in...

my point being, EU i think can handle this one, and as far
as memory management goes, what can be faster than junk={}???
certainly NOT a procedure call for jimminie sakes!!!
"but i wanna reclaim the mem used by a real"
    maxX=0
turns it into an int...(or does it?)
"but i'm still holding those couple bytes"
declare the variable inside a proc or func then, or even
locally to a specific file...

okay, this stream of conciousness can be summed by saying
that i really don't think that any real speed gains can
be had, even if EU doesn't optimize the case i presented,
and as for memory management, you'd be really hard pressed
to outperform, or make a mechanism that is as readable, as
junk={}.

*sounds of lotsa rubles rolling around, freshly minted*
--Hawke'

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu