Skip to content

Instantly share code, notes, and snippets.

@ctb
Created September 4, 2016 04:07
Show Gist options
  • Save ctb/ce69abe77a40e4936f42652dfd41cb38 to your computer and use it in GitHub Desktop.
Save ctb/ce69abe77a40e4936f42652dfd41cb38 to your computer and use it in GitHub Desktop.
Simple benchmarking script for khmer
import random
import timeit
dna = ['A', 'C', 'G', 'T'] * 10000
random.seed(1)
random.shuffle(dna)
dna = "".join(dna)
import khmer
print(khmer)
kh = khmer._Nodegraph(31, [1])
def fn():
kh.get_kmer_hashes(dna)
print(timeit.timeit(fn, number=100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment