Created
March 11, 2016 10:38
-
-
Save bicycle1885/78a5fb65dea6b3ac4a4d to your computer and use it in GitHub Desktop.
MurmurHash3
This file contains hidden or 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
| using Bio.Seq | |
| let | |
| str = "ACGT"^10000 | |
| seq = DNASequence(str) | |
| seq′ = DNASequence("AAA" * str)[4:end] | |
| @assert hash(seq) === hash(seq′) | |
| println("ASCIIString") | |
| hash(str) | |
| @time for _ in 1:100; hash(str); end | |
| @time for _ in 1:100; hash(str); end | |
| @time for _ in 1:100; hash(str); end | |
| println() | |
| println("DNASequence (aligned)") | |
| hash(seq) | |
| @time for _ in 1:100; hash(seq); end | |
| @time for _ in 1:100; hash(seq); end | |
| @time for _ in 1:100; hash(seq); end | |
| println() | |
| println("DNASequence (unaligned)") | |
| hash(seq′) | |
| @time for _ in 1:100; hash(seq′); end | |
| @time for _ in 1:100; hash(seq′); end | |
| @time for _ in 1:100; hash(seq′); end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment