Permalink
Browse files

add benchmarks for standard lib fns on strings & arrays

  • Loading branch information...
1 parent dd74425 commit 6662f5769f842c4e79d0790d1202c0558057a239 @swannodette swannodette committed Apr 30, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 benchmark/cljs/benchmark_runner.cljs
@@ -31,6 +31,15 @@
(simple-benchmark [coll [1 2 3]] (satisfies? ISeq coll) 1000000)
(println)
+(println ";;; array & string ops")
+(simple-benchmark [coll (array 1 2 3)] (seq coll) 1000000)
+(simple-benchmark [coll "foobar"] (seq coll) 1000000)
+(simple-benchmark [coll (array 1 2 3)] (first coll) 1000000)
+(simple-benchmark [coll "foobar"] (first coll) 1000000)
+(simple-benchmark [coll (array 1 2 3)] (nth coll 2) 1000000)
+(simple-benchmark [coll "foobar"] (nth coll 2) 1000000)
+(println)
+
(println ";;; list ops")
(simple-benchmark [coll (list 1 2 3)] (first coll) 1000000)
(simple-benchmark [coll (list 1 2 3)] (-first coll) 1000000)

0 comments on commit 6662f57

Please sign in to comment.