Skip to content

Commit

Permalink
Merge branch 'release/0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Nov 25, 2012
2 parents 92df80e + 6552307 commit db032d4
Show file tree
Hide file tree
Showing 5 changed files with 289 additions and 39 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,40 @@ The top level interface is in `criterium.core`.

Use `bench` to run a benchmark in a simple manner.

(bench (Thread/sleep 1000) :verbose)
```
(bench (Thread/sleep 1000))
=>
Execution time mean : 1.000803 sec
Execution time std-deviation : 328.501853 us
Execution time lower quantile : 1.000068 sec ( 2.5%)
Execution time upper quantile : 1.001186 sec (97.5%)
```

By default bench is quiet about its progress. Run `with-progress-reporting` to
get progress information on *out*.
get progress information on `*out*`.

(with-progress-reporting (bench (Thread/sleep 1000) :verbose))
(with-progress-reporting (quick-bench (Thread/sleep 1000) :verbose))
```clj
(with-progress-reporting (bench (Thread/sleep 1000) :verbose))
(with-progress-reporting (quick-bench (Thread/sleep 1000) :verbose))
```

Lower level functions are available, that separate benchmark statistic
generation and reporting.

(report-result (benchmark (Thread/sleep 1000)) :verbose)
(report-result (quick-benchmark (Thread/sleep 1000)))
```clj
(report-result (benchmark (Thread/sleep 1000)) :verbose)
(report-result (quick-benchmark (Thread/sleep 1000)))
```

Note that results are returned to the user to prevent JIT from recognising that
the results are not used. For functions that are very fast, or return a lot of
data, you may need to supply a function to reduce the results to prevent
excessive memory allocation.

(bench (rand) :reduce-with +)
excessive memory allocation. The default for :reduce-with adds the hash codes of
the results.

```clj
(bench (rand) :reduce-with +)
```

## References

Expand Down
27 changes: 26 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# Release Notes

Current version is 0.3.0
Current version is 0.3.1

# 0.3.1

- Add macro 'benchmark-round-robin' that is like benchmark, but takes a
sequence of expressions
The goal is to see whether the results are noticeably different when
executed 'round robin' instead of doing the same expression over and over
for an extended period of time (e.g. 1 min). Instead try 10 different
expressions for 100 millisec each, for example, and then repeat that 60
times if :sample-count is 60.

One needs to be cautious in interpreting the results, e.g. if one
expression in the sequence tends to leave behind lots of garbage that
won't be collected until a later expression is being executed.

- Change execute-expr so it has less overhead per execution of the
benchmarked expression.

- Return options used as part of benchmark* return value

- Add Clojure version and system property sun.arch.data.model to
runtime-details return value.

- Add the values of system properties java.version and java.runtime.version
to return value of runtime-details.

# 0.3.0

Expand Down
12 changes: 12 additions & 0 deletions profiles.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{:dev
{:dependencies [[codox-md "0.1.0"]]
:codox {:writer codox-md.writer/write-docs}
:autodoc {:name "Criterium"
:description "A benchmarking library."
:copyright "Copyright Hugo Duncan 2010, 2011, 2012. All rights reserved."
:web-src-dir "http://github.com/hugoduncan/criterium/blob/"
:web-home "http://hugoduncan.github.com/criterium/" }}
:release
{:plugins [[lein-set-version "0.2.1"]]
:set-version
{:updates [{:path "README.md" :no-snapshot true}]}}}
10 changes: 2 additions & 8 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
(defproject criterium "0.3.0"
(defproject criterium "0.3.1"
:description "Benchmarking library"
:url "https://github.com/hugoduncan/criterium"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.3.0"]]
:local-repo-classpath true
:codox {:writer codox-md.writer/write-docs}
:autodoc {:name "Criterium"
:description "A benchmarking library."
:copyright "Copyright Hugo Duncan 2010, 2011, 2012. All rights reserved."
:web-src-dir "http://github.com/hugoduncan/criterium/blob/"
:web-home "http://hugoduncan.github.com/criterium/" })
:local-repo-classpath true)
Loading

0 comments on commit db032d4

Please sign in to comment.