[racket-dev] member like assoc

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Jun 9 22:15:31 EDT 2013

Sorry: I should have been clearer: I would only expect a difference when
the list is short (so your benchmark 2).

Robby

On Sunday, June 9, 2013, Asumu Takikawa wrote:

> On 2013-06-09 20:51:21 -0500, Robby Findler wrote:
> >    Do the times change if you put an 'in-range' in the for loops?
>
> Is this the code change you meant?
>
>   #lang racket/base
>   (require (only-in racket/list range))
>   (define lst (range 1 5000))
>   (time
>     (for ([i (in-range 30000)])
>       (member 2500 lst)))
>
>   ;;; NEW BRANCH
>   $ racket member-benchmark-3.rkt
>   cpu time: 1756 real time: 1760 gc time: 0
>   $ racket --no-jit member-benchmark-3.rkt
>   cpu time: 1524 real time: 1530 gc time: 0
>
>   ;;; MASTER
>   $ racket member-benchmark-3.rkt
>   cpu time: 1756 real time: 1761 gc time: 0
>   $ racket --no-jit member-benchmark-3.rkt
>   cpu time: 1532 real time: 1535 gc time: 0
>
> Cheers,
> Asumu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130609/cb7e16c1/attachment.html>

Posted on the dev mailing list.