-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'm currently working on another performance-critical project that uses this crate. I'm inspecting generated assembly code and noted some possible improvements to this crate. Before I forget all of this, here is a random list of notes:
Usingbitvec[index]is bad: because that crate uses thestatic TRUE/FALSEtrick to in the[]operator we have a branch where there shouldn't be one. Usegetinstead or something like thatFirst indexing the bitvec and then the data vec does two bound checks. That's bad. Everywhere where we usehas_element_at(and it returnstrue), we should useget_uncheckedor so.- Setting or resetting a bit (done via
&or|with a mask) is not optimized well. This should (probably be done) with the BTS and BTR instructions on x86. Have too look into this.
(This issue is rather a reminder to myself...)
Metadata
Metadata
Assignees
Labels
No labels