Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update benchmarks to Perforate 0.2.0.

  • Loading branch information...
commit 6c809c44982e67a8b6efacac36140e28ef412bac 1 parent 9941381
@davidsantiago authored
Showing with 25 additions and 27 deletions.
  1. +17 −21 benchmarks/csv/benchmarks/core.clj
  2. +8 −6 project.clj
View
38 benchmarks/csv/benchmarks/core.clj
@@ -29,24 +29,20 @@
(when (not (data-present?))
(get-cbp-data)))
-(def read-test
- (benchmark "CSV Read Speed"
- :setup #(get-cbp-data-if-missing)
- :cases [(benchmark-case :default
- (fn []
- (let [csvfile (slurp data-file)]
- [(fn []
- (dorun 50000
- (parse-csv csvfile)))])))]))
-
-(def write-test
- (benchmark "CSV Write Speed"
- :setup #(get-cbp-data-if-missing)
- :cases [(benchmark-case :default
- (fn []
- (let [csvfile (slurp data-file)
- cbp02 (doall
- (take 50000
- (parse-csv csvfile)))]
- [(fn []
- (doall (write-csv cbp02)))])))]))
+
+(defgoal read-test "CSV Read Speed"
+ :setup get-cbp-data-if-missing)
+
+(defcase* read-test :clojure-csv
+ (fn []
+ (let [csvfile (slurp data-file)]
+ [(fn [] (dorun 50000 (parse-csv csvfile)))])))
+
+(defgoal write-test "CSV Write Speed"
+ :setup get-cbp-data-if-missing)
+
+(defcase* write-test :clojure-csv
+ (fn []
+ (let [csvfile (slurp data-file)
+ cbp02 (doall (take 50000 (parse-csv csvfile)))]
+ [(fn [] (doall (write-csv cbp02)))])))
View
14 project.clj
@@ -1,17 +1,19 @@
(defproject clojure-csv "2.0.0-alpha1"
:description "A simple library to read and write CSV files."
- :dependencies [[org.clojure/clojure "1.3.0"]
- [perforate "0.1.1"]]
- :plugins [[perforate "0.1.1"]]
+ :dependencies [[org.clojure/clojure "1.3.0"]]
+ :plugins [[perforate "0.1.2-SNAPSHOT"]]
:jvm-opts ["-Xmx1g"]
:profiles {:current {:source-paths ["src/"]}
:clj1.4 {:dependencies [[org.clojure/clojure "1.4.0-beta5"]]}
:clj1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
:csv1.3 {:dependencies [[clojure-csv "1.3.0"]]}
:csv2.0 {:dependencies [[clojure-csv "2.0.0-alpha1"]]}}
- :perforate {:environments [{:profiles [:clj1.3 :csv2.0]
+ :perforate {:environments [{:name :clojure-csv2
+ :profiles [:clj1.3 :csv2.0]
:namespaces [csv.benchmarks.core]}
- {:profiles [:clj1.3 :csv1.3]
+ {:name :clojure-csv1
+ :profiles [:clj1.3 :csv1.3]
:namespaces [csv.benchmarks.core]}
- {:profiles [:clj1.4 :current]
+ {:name :current
+ :profiles [:clj1.4 :current]
:namespaces [csv.benchmarks.core]}]})
Please sign in to comment.
Something went wrong with that request. Please try again.