[racket-dev] member like assoc

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Sun Jun 9 22:26:04 EDT 2013

On 2013-06-09 21:15:31 -0500, Robby Findler wrote:
>    Sorry: I should have been clearer: I would only expect a difference when
>    the list is short (so your benchmark 2).

Here're the numbers for that:

  #lang racket/base
  (define lst '(a b c))
  (time
    (for ([i (in-range 30000000)])
      (member 'b lst)))

  ;;; NEW BRANCH
  $ racket member-benchmark-4.rkt
  cpu time: 1408 real time: 1414 gc time: 0
  $ racket --no-jit member-benchmark-4.rkt
  cpu time: 3724 real time: 3731 gc time: 0

  ;;; MASTER
  $ racket member-benchmark-4.rkt
  cpu time: 1380 real time: 1384 gc time: 0
  $ racket --no-jit member-benchmark-4.rkt
  cpu time: 3616 real time: 3622 gc time: 0

Cheers,
Asumu

Posted on the dev mailing list.