For those wishing to read up on this subject, an excellent starting point is this comprehensive post by one of the main contributors of the fast algorithm currently used in core:
https://old.reddit.com/r/rust/comments/omelz4/making_rust_fl...