-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed from 1.3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use this here, but need it for BitArrayFile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the ability to compare two BitArray objects. This makes it a bit easier to add tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this because it allows parallelising bloom filter creation. I don't personally need this method, but figured it might be useful for others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following two methods, dump and load, are new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually fairly easy to implement the rest of BitArray, allowing this to be read/write instead of read-only. But it's quite a bit slower, at least for large bitarrays and nobody's likely to care for small bitarrays. Seemed to be unnecessary bloat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm more familiar with rspec. Please excuse me if these tests aren't how most people would write Minitest tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a way, Minitest is to RSpec as Sinatra is to Rails. Minitest is far less opinionated and freeform which has upsides and downsides, but a big upside is pretty much any approach that works and fits into a project's own style is all good! :)
peterc
commented
May 3, 2022
I've merged the previous one but this will take a little bit more review - thanks for now though!
73f65aa to
9c070df
Compare
yegct
commented
May 3, 2022
I've merged the previous one but this will take a little bit more review - thanks for now though!
Rebased off of main. If you don't like/want the union, let me know and I'll drop that (and associated tests). If you want me to do some cleanup, happy to do that too.
Uh oh!
There was an error while loading. Please reload this page.
What
This PR allows
BitArrayto be dumped to disk and subsequently loaded from disk. It also adds the ability to union two bitarrays. And there's a new class,BitArrayFile, allowing for read-only access to a dumpedBitArray, providing a means to query the array without having to load it in to RAM.Tests
Additionally, I tested this with a bitarray consisting of a little over 2 billion bits. I was able to
dump,load, and useBitArrayFileto query the bits.