Skip to content

Instantly share code, notes, and snippets.

@kescobo
Created March 18, 2017 16:14
Show Gist options
  • Save kescobo/8bf9e64f1fecd6b3e456ef4bbeb03e17 to your computer and use it in GitHub Desktop.
Save kescobo/8bf9e64f1fecd6b3e456ef4bbeb03e17 to your computer and use it in GitHub Desktop.
Benchmarks for new implementation of kmerminhash
b1 = open(FASTAReader,
"/Users/ksb/computation/science/genomes/kv_input/fasta/Brachybacterium_alimentarium_738_10.fna")
seq1 = dna""
for s in b1
seq1 = seq1 * s.seq
end
length(seq1) # 4160958
b1 = open(FASTAReader,
"/Users/ksb/computation/science/genomes/kv_input/fasta/Brachybacterium_alimentarium_738_10.fna")
seq2 = DNASequence[]
for s in b1
push!(seq2, s.seq)
end
using BenchmarkTools
@benchmark sk1 = minhash(seq1, 12, 5000)
@benchmark sk2 = minhash(seq2, 12, 5000)
@benchmark sk3 = minhash(seq1, 12, 5000)
## New Minhash on concatenated sequences
# BenchmarkTools.Trial:
# memory estimate: 128.75 KiB
# allocs estimate: 18
# --------------
# minimum time: 104.309 ms (0.00% GC)
# median time: 107.608 ms (0.00% GC)
# mean time: 107.805 ms (0.00% GC)
# maximum time: 111.584 ms (0.00% GC)
# --------------
# samples: 47
# evals/sample: 1
# time tolerance: 5.00%
# memory tolerance: 1.00%
## Old Minhash on concatenated sequences
# BenchmarkTools.Trial:
# memory estimate: 128.75 KiB
# allocs estimate: 18
# --------------
# minimum time: 106.780 ms (0.00% GC)
# median time: 111.939 ms (0.00% GC)
# mean time: 112.147 ms (0.00% GC)
# maximum time: 117.537 ms (0.00% GC)
# --------------
# samples: 45
# evals/sample: 1
# time tolerance: 5.00%
# memory tolerance: 1.00%
## New Minhash on vector of sequences
# BenchmarkTools.Trial:
# memory estimate: 134.45 KiB
# allocs estimate: 310
# --------------
# minimum time: 104.206 ms (0.00% GC)
# median time: 107.434 ms (0.00% GC)
# mean time: 107.680 ms (0.00% GC)
# maximum time: 115.070 ms (0.00% GC)
# --------------
# samples: 47
# evals/sample: 1
# time tolerance: 5.00%
# memory tolerance: 1.00%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment