Here is a comparison of itertools::all_equal with two alternatives for a vector consisting of 5_000_000 zeroes followed by 5_000_000 ones on rust playground:
- using
itertools::all_equal: 607 msecs
- using
any: 487 msecs
- using a simple for loop: 536 msecs
i would love if all_qual was as fast
playground
Here is a comparison of
itertools::all_equalwith two alternatives for a vector consisting of 5_000_000 zeroes followed by 5_000_000 ones on rust playground:itertools::all_equal: 607 msecsany: 487 msecsi would love if
all_qualwas as fastplayground