chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Speeding up bit-vector operation (using iset)


From: Alex Shinn
Subject: Re: [Chicken-users] Speeding up bit-vector operation (using iset)
Date: Wed, 17 Mar 2010 21:18:49 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

Lasse Kliemann <address@hidden> writes:

> It creates two large bit-vectors, initializes them with
> random entries, and then performs and, ior, and nand
> operations (corresponding to intersection, union, and
> difference of the sets defined by the vectors) a number of
> 10 times.

At 2^26 bits each I would say these are *huge* bit-vectors.

> (do
>   ((i 0 (+ 1 i)))
>   ((= i 10))
>   (bit-vector-and s1 s2)
>   (bit-vector-ior s1 s2)
>   (bit-vector-and s1 (bit-vector-nand s2)))

These operations are generating three new huge bit-vectors
on each iteration, so you're spending all your time in GC
(and the loop has no effect).

If you want to do in-place bit-vector operations you want
`bit-vector-and!' and `bit-vector-ior!' (with the trailing
exclamation point).

-- 
Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]