that's great!

Robby

On Sat, Sep 19, 2015 at 4:38 PM, Gustavo Massaccesi <gust...@oma.org.ar> wrote:
> There is something very strange with memq vs member:
> http://pasterack.org/pastes/80845  (note: I added one 0 to the loop
> constants)
>
> I used two mutable variables eq?? and equal?? to avoid (most of) the
> optimizations and I get that the time with equal? is 2x than the time
> with eq?. This is closer to the range I expected.
>
> Using directly eq? and equal? is slightly faster, and the time is the
> same because under the hood the optimizer transforms equal? to eq?
> when one of the arguments is an explicit symbol.
>
> The implementation of member and memq is very short but very
> entangled. I think that with some tweaks is possible to reduce the
> time difference to x2, and with some luck to make it more optimizer
> friendly and gain some additional speed.
>
> Gustavo
>
>
>
> On Thu, Sep 17, 2015 at 11:01 PM, Sam Tobin-Hochstadt
> <sa...@cs.indiana.edu> wrote:
>> Unfortunately, that's only true when eq? produces #t, which probably isn't
>> an issue when using eq? directly, but can be when using memq or similar.
>> This benchmark suggests about a 10x speed difference when the symbols are
>> different: http://pasterack.org/pastes/94877
>>
>> Sam
>>
>>
>> On Thu, Sep 17, 2015, 9:52 PM Robby Findler <ro...@eecs.northwestern.edu>
>> wrote:
>>>
>>> FWIW, if you use equal? in those cases, you'll get the same
>>> performance behavior and you will have fewer eq?s to audit when things
>>> go wonky.
>>>
>>> ;)
>>>
>>> Robby
>>>
>>> On Thu, Sep 17, 2015 at 8:36 PM, Neil Van Dyke <n...@neilvandyke.org>
>>> wrote:
>>> > Whew. :)  I only rarely have a non-symbol use for `eq?`, but I use `eq?`
>>> > heavily for symbols in everyday application code.
>>> >
>>> > Robby Findler wrote on 09/17/2015 09:27 PM:
>>> >>
>>> >> eq? on symbols is a special part of the specification and that seems
>>> >> benign to me, all things considered. The "giant hash in the sky" that
>>> >> makes sure that works isn't exactly trouble free, but we seem to have
>>> >> it under control.
>>> >
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "Racket Users" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an
>>> > email to racket-users+unsubscr...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to