On Fri, Feb 8, 2013 at 10:56 AM, Jens Axel Søgaard
<[email protected]>wrote:

> Try
>            [xs  (if (list? xs) xs (sequence->list xs))])
> and see what the new timings are.
>

Perfect! I'm glad it was so simple.

old mean:
cpu time: 3621 real time: 3621 gc time: 2613
494936207/10000000

new mean:
cpu time: 564 real time: 563 gc time: 0
494936207/10000000

my-mean:
cpu time: 512 real time: 515 gc time: 132
494936207/10000000

Had to explicitely cast xs to a list of reals:
(cast (if (list? xs) xs (sequence->list xs))
      (Listof Real))

But shouldn't this patch be applied directly to sequence->list instead?

Laurent
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to