This crate uses Vec<bool> as its primary data structure on which diffs are performed:
|
removed: Vec<bool>, |
|
added: Vec<bool>, |
This needs 8 bits of space for every 1 bit of semantic information. We could technically reduce the memory consumption of these data by ~8X by employing a bit vector.
I would assume that a drastic reduction in memory consumption will make the algorithm perform a lot better. The overhead of the added bit operations is likely negligible in contrast to the reduction of cache misses.
Is this something you have looked into? If yes, can you outline why you decided against using bit vectors?
As the set of operations on this data structure is fairly limited in the context of this crate, it should be straightforward to implement a custom version of this directly in this crate. Alternatively, it is possible to an existing solution like https://crates.io/crates/bitvec.
Please let me know if I am missing something obvious.
This crate uses
Vec<bool>as its primary data structure on which diffs are performed:imara-diff/src/lib.rs
Lines 231 to 232 in 055f8e3
This needs 8 bits of space for every 1 bit of semantic information. We could technically reduce the memory consumption of these data by ~8X by employing a bit vector.
I would assume that a drastic reduction in memory consumption will make the algorithm perform a lot better. The overhead of the added bit operations is likely negligible in contrast to the reduction of cache misses.
Is this something you have looked into? If yes, can you outline why you decided against using bit vectors?
As the set of operations on this data structure is fairly limited in the context of this crate, it should be straightforward to implement a custom version of this directly in this crate. Alternatively, it is possible to an existing solution like https://crates.io/crates/bitvec.
Please let me know if I am missing something obvious.