Skip to content

Instantly share code, notes, and snippets.

@bicycle1885
Created March 11, 2016 10:38
Show Gist options
  • Save bicycle1885/78a5fb65dea6b3ac4a4d to your computer and use it in GitHub Desktop.
Save bicycle1885/78a5fb65dea6b3ac4a4d to your computer and use it in GitHub Desktop.
MurmurHash3
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