-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b62bd28
commit 5d1b980
Showing
5 changed files
with
36,939 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns cljam.io.bam.decoder-bench | ||
(:require [libra.bench :refer [defbench are]] | ||
[libra.criterium :as c] | ||
[cljam.test-common :as tcommon] | ||
[cljam.io.sam :as sam])) | ||
|
||
(defbench decode-bam-alignment-short-bench | ||
(are [f] | ||
(c/quick-bench | ||
(with-open [r (sam/reader f)] | ||
(dorun (sam/read-alignments r)))) | ||
tcommon/test-bam-file | ||
tcommon/medium-bam-file | ||
tcommon/codec-benchmark-bam-file)) | ||
|
||
(defbench decode-bam-alignment-long-bench | ||
(are [f] | ||
(c/quick-bench | ||
(with-open [r (sam/reader f)] | ||
(dorun (vec (take 10000000 (sam/read-alignments r)))))) | ||
tcommon/large-bam-file)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(ns cljam.io.bam.encoder-bench | ||
(:require [libra.bench :refer [defbench are]] | ||
[libra.criterium :as c] | ||
[cljam.test-common :as tcommon] | ||
[cljam.io.sam :as sam])) | ||
|
||
(defbench encode-alignment-short-bench | ||
(tcommon/with-before-after {:before (tcommon/prepare-cache!) | ||
:after (tcommon/clean-cache!)} | ||
(are [f] | ||
(with-open | ||
[r (sam/reader f) | ||
w (sam/writer (str tcommon/temp-dir "/encode-alignment-bench.bam"))] | ||
(let [header (sam/read-header r) | ||
aln (sam/read-alignments r)] | ||
(c/quick-bench (sam/write-alignments w aln header)))) | ||
tcommon/test-sam-file | ||
tcommon/medium-sam-file | ||
tcommon/codec-benchmark-sam-file))) | ||
|
||
(defbench encode-alignment-long-bench | ||
(tcommon/with-before-after {:before (tcommon/prepare-cache!) | ||
:after (tcommon/clean-cache!)} | ||
(are [f] | ||
(with-open | ||
[r (sam/reader f) | ||
w (sam/writer (str tcommon/temp-dir "/encode-alignment-bench.bam"))] | ||
(let [header (sam/read-header r) | ||
aln (sam/read-alignments r)] | ||
(c/quick-bench (sam/write-alignments w (vec (take 2000000 aln)) header)))) | ||
tcommon/large-bam-file))) |
Binary file not shown.
Oops, something went wrong.