d-led / htm.pony

an HTM experiment in Pony based on the Go implementation https://github.com/htm-community/htm/
GNU Affero General Public License v3.0
3 stars 0 forks source link

Port the Dense Matrix to a Bit Vector implementation #5

Closed d-led closed 5 years ago

d-led commented 5 years ago

the current Dense Matrix is based on a vector of Bools. This might be a waste of space.

TODO: analyze the space taken by the bool vector, and create a BitArrayDenseMatrix, e.g. based on lisael/pony-bitarray (fixed version) to see and benchmark #4, whether this is valuable

d-led commented 5 years ago

Benchmark shows, it's a space vs. speed trade-off, as expected

Benchmark                                   mean            median   deviation  iterations
Bitarray Push                           10807 ns          10812 ns      ±0.88%       10000
BoolArray Push                           2360 ns           2357 ns      ±1.12%      100000
Bitarray Apply                           5224 ns           5244 ns      ±1.80%       30000
BoolArray Apply                           520 ns            506 ns      ±7.76%      300000
d-led commented 5 years ago

this probably won't be needed at the moment. Ported the bit array library to todays's Pony: https://github.com/d-led/pony-bitarray, with which the benchmark has been produced