-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include lowercase name fields in Artist,Album,Song #79
Comments
Some benchmarks @ a4f0bf2 with only parsing:
gathering songs summed across albums:
|
hmm
|
huh
didn't really make a difference |
Hmm maybe I should think about using a crate called unicase for no allocation string case-insensitive comparisons? https://www.reddit.com/r/rust/comments/6wbru2/performance_issue_can_i_avoid_of_using_the_slow/dm6u0as/ But how would I do |
I've done quite a bit of rewriting, benchmarking and profiling. Using UniCase in |
hey but at least find is 10x faster now :)
|
XDDD find song ignore album went from 7ms to 200μs XD
to
and pub fn is_entry_lowercase_ignore_album(&self, entry: &SongEntry) -> bool {
self.album.artist.is_entry(entry) && UniCase::new(&entry.track) == UniCase::new(&self.name)
} |
So all in all |
improved performance of this in fefc4f9
in b764ae0 to
because I'm doing it far smarter now and even fixed a bug heh... |
Improve performance bc no longer stupid Thanks GitHub Copilot Chat for .then_with Also fixed bug with these functions where if you didn't sum_different_capitalization it wasn't deterministic If there were multiple capitalizations of a song in the same album But now it will always pick the correct version with the most plays!
Noticed it doing #33 that I'm calling
.to_lowercase()
a lot (bc of summing across albums and ignoring capitalization). Maybe it'd be nice if each SongEntry and song/album/artist contained anRc<str>
with its name but in lowercase. Would take up more space but I think it could speed up the computations.The text was updated successfully, but these errors were encountered: