On Fri, 2016-01-29 at 13:00 -0800, Scotty C wrote:
> ok, had time to run my hash on my one test file
> '(6000011 1 1 19 24783208 4.19)
> this means
> # buckets
> % buckets empty
> non empty bucket # keys least
> non empty bucket # keys most
> total number of keys
> average number of keys per non empty bucket
> 
> it took 377 sec.
> original # records is 26570359 so 6.7% dupes.
> processing rate is 70478/sec
> 
> my plan right now is to rework my current hash so that it runs byte
> strings instead of bignums. i will probably be tomorrow afternoon
> before i have more stats.
> 
> question for you all. right now i use modulo on my bignums. i know i
> can't do that to a byte string. i'll figure something out. if any of
> you know how to do this, can you post a method?
> 

I'm not sure what your asking exactly. Because a byte string is an
array, all you need to do is jump to the byte your information is in
and then get your bit out. So let's just say you want to get the nth
bit in an array of 8-bit bytes. You first need to calculate which byte
your bit is in, which is clearly (bytes-ref data (floor (/ n 8))). Then
you get the bit out of it, which would be something (untested) like
(modulo (arithmetic-shift (bytes-ref data (floor (/ n 8))) (* -1
(modulo n 8))) 2). This is easy enough to modify for elements that are
a divisor of 8 in size.

Regards,
Brandon Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to