Closed crypdoughdoteth closed 2 months ago
Hey, i really appreciate the effort!! Unfortunately we have a version 0.4.0 that is in the making which probably solves lots of these. If you mind looking into the release/0.4.0 branch to see.
If you're willing to re-implement the changes based on branch release/v0.4.0
please note that we use the nightly rustfmt!
Did you measure contention on the mutex? In practice it takes a fraction of a second to hash all the dependencies so I have not observed degraded performance.
My pleasure, I reimplemented against the v0.4.0 branch and will open a new PR shortly 🫡
re: Mutex: I did not measure the contention levels, but contention is the worst case scenario for Mutex performance. Each thread is attempting to write to the same memory location in a very short time slice in both instances. This can become an issue when projects gets larger and there is simply more hashes and files names to write. The best case is pointer chasing (a serially-dependent chain of loads to access the underlying data), which strictly underperforms MPSC in this case. Interior mutability is best to avoid if there's a better solution.
.sort_unstable()
and.sort_unstable_by()
.position_any()
,.any()
write_lock()