Re: Optimization Question for Robert

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert Craig wrote:

>If the variable is declared as a sequence, you can do
>this by assigning {}, but otherwise 0 will do the job
>using less memory. In your case, bitmap[index] = 0 would
>be slightly better.

Yeah, that's how I implemented it.

I was trying to figure out if {} was implemented as a "special" value (say,
a pointer to address 0, or a pointer to a globally shared empty sequence),
in which case I figured it would take the same amount of memory as an
integer 0.

Never mind...

>I've been considering an optimization along these lines,
>where Euphoria would remove a reference earlier, when
>it was sure that the variable's value would no longer be needed.

Like this?

    dest = source
    ...
    source = dest

Sounds like a lot of work, but you compiler writers are just gluttons for
punishment, right?

>      x = sort(x)


Even I can understand this one.

Thanks!

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu