Skip to content

Commit

Permalink
Add benchmark code for vcf reader
Browse files Browse the repository at this point in the history
  • Loading branch information
athos committed Nov 15, 2023
1 parent 45d60a8 commit bab0ae8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bench/cljam/io/vcf_bench.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(ns cljam.io.vcf-bench
(:require [cljam.io.vcf :as vcf]
[cljam.test-common :as tcommon]
[libra.bench :refer [are defbench]]
[libra.criterium :as c]))

(defbench decode-small-bcf-bench
(are [f]
(c/quick-bench
(with-open [r (vcf/reader f)]
(run! (constantly nil) (vcf/read-variants r))))
tcommon/test-bcf-complex-file))

(defbench decode-large-bcf-bench
(are [f]
(c/quick-bench
(with-open [r (vcf/reader f)]
(run! (constantly nil) (vcf/read-variants-randomly r {:chr "chr1" :end 30000000} {}))))
tcommon/test-large-bcf-file))

0 comments on commit bab0ae8

Please sign in to comment.