Hi all.  Suppose I have a large matrix with entries {0, 1} and I'd like to 
keep storage small by using a BitMatrix.  Are there any tricks to squeeze 
better performance out of BitMatrix multiplication?  I'm also curious about 
the performance difference between Matrix{Bool} and Matrix{Int8}.  Thoughts 
or suggestions are appreciated.  Thanks.

n, p = 1000, 100_000
x1 = rand(n, p) .> .5
x2 = Matrix{Bool}(x1)
x3 = Matrix{Float64}(x1)
x4 = Matrix{Int8}(x1)
b = randn(p)

@time x1 * b
@time x2 * b
@time x3 * b
@time x4 * b
  0.559938 seconds (7 allocations: 8.078 KB)
  0.437336 seconds (7 allocations: 8.078 KB)
  0.062144 seconds (7 allocations: 8.078 KB)
  0.109573 seconds (7 allocations: 8.078 KB)

Reply via email to