Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
~2x speed increase on findAudioDuplicates
Speed increased around 2x by using gmpy.popcount and better data handling Also, added some test code to compareSongs that runs the comparison twice to test both results (by previous and current core) are equivalent. The test set is a collection of 4759 songs and the results are: Before this commit: >>> p.print_stats() Fri Aug 4 10:17:41 2017 profile_bard_idx 301527142 function calls (301522248 primitive calls) in 215.097 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 330/1 0.007 0.000 215.097 215.097 {built-in method builtins.exec} 1 0.000 0.000 215.097 215.097 /usr/bin/bard:2(<module>) 1 0.000 0.000 214.944 214.944 /home/antonio/git/antlarr/bard/bard/bard.py:777(main) 1 0.053 0.053 214.943 214.943 /home/antonio/git/antlarr/bard/bard/bard.py:607(parseCommandLine) 1 0.059 0.059 214.885 214.885 /home/antonio/git/antlarr/bard/bard/bard.py:462(findAudioDuplicates) 3578 0.162 0.000 213.436 0.060 /home/antonio/git/antlarr/bard/bard/bard.py:58(compareChromaprintFingerprintsAndOffset) 354222 102.851 0.000 213.171 0.001 /home/antonio/git/antlarr/bard/bard/bard.py:35(compareChromaprintFingerprints) 299543702 110.207 0.000 110.207 0.000 /home/antonio/git/antlarr/bard/bard/bard.py:18(bitsoncount) 54 0.650 0.012 0.650 0.012 {method 'execute' of 'sqlite3.Cursor' objects} After this commit: >>> p.print_stats() Fri Aug 4 18:17:44 2017 profile_bard_gmpy 301564162 function calls (301557572 primitive calls) in 127.292 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 424/1 0.007 0.000 127.292 127.292 {built-in method builtins.exec} 1 0.000 0.000 127.292 127.292 /usr/bin/bard:2(<module>) 1 0.000 0.000 127.099 127.099 /home/antonio/git/antlarr/bard/bard/bard.py:847(main) 1 0.128 0.128 127.099 127.099 /home/antonio/git/antlarr/bard/bard/bard.py:677(parseCommandLine) 1 0.084 0.084 126.966 126.966 /home/antonio/git/antlarr/bard/bard/bard.py:509(findAudioDuplicates) 3578 0.300 0.000 123.672 0.035 /home/antonio/git/antlarr/bard/bard/bard.py:105(compareChromaprintFingerprintsAndOffset2) 354222 98.899 0.000 123.290 0.000 /home/antonio/git/antlarr/bard/bard/bard.py:38(compareChromaprintFingerprints) 299543702 24.271 0.000 24.271 0.000 {built-in method gmpy.popcount} 3616 1.857 0.001 1.857 0.001 /home/antonio/git/antlarr/bard/bard/bard.py:526(<listcomp>) 54 0.647 0.012 0.647 0.012 {method 'execute' of 'sqlite3.Cursor' objects}
- Loading branch information
Showing
1 changed file
with
101 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters