bit sets in IntSet vs. Integer

Henning Thielemann lemming at henning-thielemann.de
Sat Jun 18 13:59:55 UTC 2016


In my set-cover package I make extensive use of bit vectors. I tested both 
IntSet and Integer for this purpose. In GHC-7.4.2 Integer was visibly 
faster than IntSet, but in GHC-7.8.4 and later, IntSet clearly wins over 
Integer. I guess this can be attributed to IntSet using BitMaps at the 
leaves since containers-0.5. However, on a 64-bit machine a BitMap is a 
Word64. I wondered whether we could get further speedup by using a vector 
type. E.g. AVX processors could perform bit manipulations on 256 bit 
words. Do the bit operations on Integer make use of vector instructions?


More information about the Libraries mailing list