[racket] bytes, bit-vectors and sieving numbers

From: Jay Kominek (kominek at gmail.com)
Date: Thu May 1 13:27:32 EDT 2014

On Thu, May 1, 2014 at 5:55 AM, Tim Brown <tim.brown at cityc.co.uk> wrote:
> I assume that the load is in "bit-vector-ref"; there is a lot of
> type-checking around it, and a tantalisingly un-provided unsafe version,
> too :-)

I poked at bit-vector.rkt for fun, and your bit vector version can be
made to run in 60% the time if the quotient/remainder calls in
bit-vector.rkt are replaced with bitwise operations:

https://github.com/jkominek/racket/tree/bitwise-bit-vectors

The above change plus using unsafe-bit-vector-ref takes you down to
15% of the run time.

-- 
Jay Kominek

Posted on the users mailing list.