petgraph / fixedbitset

A simple bitset container for Rust
https://docs.rs/fixedbitset/
Apache License 2.0
124 stars 47 forks source link

inline count_ones() #11

Closed fuine closed 7 years ago

fuine commented 7 years ago

This small PR fixes lack of inlining in count_ones. During profiling of some hot code which used count_ones i noticed that both count_ones and count_ones_impl are not tagged as #[inline] which can lead to significant performance loss if you call them in a tight loop. Note that almost all, if not all methods of fixedbitset are tagged as #[inline].