Skip to content

Commit 8909a64

Browse files
committed
release v0.1.1
1 parent 408725a commit 8909a64

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

README.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ You can also build the binary yourself. You will need [Leiningen](https://leinin
2626

2727
The author's [Advent Of Code 2021 Clojure solutions](https://github.com/erdos/advent-of-code) are used for benchmarking. The values are runtimes in _mean + standard deviation_ format in milliseconds, the smaller is the better. See `benchmark.clj` for details.
2828

29-
| test case | uclj | [bb v0.7.0](https://github.com/babashka/babashka) | [clojure 1.10.3](https://clojure.org/)
29+
| test case | uclj | [bb v0.7.3](https://github.com/babashka/babashka) | [clojure 1.10.3](https://clojure.org/)
3030
| --------- | ---- | ------------------------------------------------- | ---------------------------------------
31-
| day1.clj | 18+6 | 29+1 | 931+62
32-
| day2.clj | 36+23 | 30+1 | 925+34
33-
| day3.clj | 65+7 | 183+23 | 1024+69
34-
| day4.clj | 216+6 | 457+1 | 1073+52
35-
| day5.clj | 4599+42 | 5009+169 | 2629+226
36-
| day6.clj | 11+0 | 9+0 | 894+6
37-
| day8.clj | 105+6 | 106+0 | 1284+172
38-
| day9.clj | 645+3 | 661+118 | 1607+37
39-
| day24.clj | 4639+175 | 7494+98 | 1409+13
31+
| day1.clj | 22+1 | 30+1 | 913+40
32+
| day2.clj | 25+1 | 32+1 | 936+16
33+
| day3.clj | 66+2 | 180+7 | 1032+24
34+
| day4.clj | 184+5 | 515+15 | 1062+40
35+
| day5.clj | 4675+26 | 4823+15 | 2385+63
36+
| day6.clj | 14+1 | 9+0 | 893+48
37+
| day7.clj | 25397+91 | 24825+477 | 12172+151
38+
| day8.clj | 82+2 | 106+1 | 1064+45
39+
| day9.clj | 405+12 | 503+14 | 1131+43
40+
| day11.clj | 515+15 | 1181+43 | 1229+35
41+
| day17.clj | 3861+80 | 5152+143 | 1167+30
42+
| day19.clj | 2460+37 | 5761+145 | 2762+53
43+
| day24.clj | 1535+4 | 7266+163 | 1491+36
4044

4145
For light tasks with high number of function invocations and loops, `uclj` can be the fastest. For heavier tasks, running the `clojure` command is still winning.
4246

benchmark.clj

+17-11
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
(def scripts-dir "/home/erdos/Work/advent-of-code/2021")
66

77
(def script-files
8-
[["day1.clj" 5]
9-
["day2.clj" 5]
10-
["day3.clj" 5]
11-
["day4.clj" 2]
12-
["day5.clj" 2]
13-
["day6.clj" 2] #_"day7.clj"
14-
["day8.clj" 2]
15-
["day9.clj" 2]
16-
["day24.clj" 2]])
8+
[["day1.clj" 10]
9+
["day2.clj" 10]
10+
["day3.clj" 10]
11+
["day4.clj" 10]
12+
["day5.clj" 10]
13+
["day6.clj" 10]
14+
["day7.clj" 10]
15+
["day8.clj" 10]
16+
["day9.clj" 10]
17+
["day11.clj" 10]
18+
["day17.clj" 10]
19+
["day19.clj" 10]
20+
["day24.clj" 10]])
1721

1822
(def runners ["uclj" "bb" "clojure"])
1923

@@ -38,14 +42,16 @@
3842
(format "%d+%d" (Math/round mean) (Math/round stdev)))
3943

4044
(defn pritems [& xs]
41-
(apply printf (str (apply str (repeat (count xs) "%-20s")) "\n") xs)
45+
(apply printf (str (apply str (repeat (count xs) "| %-10s ")) "\n") xs)
4246
(flush))
4347

4448
(apply pritems "test case" runners)
4549

50+
(def warmup-count 1)
51+
4652
(doseq [[file repeat-count] script-files]
4753
(apply pritems file
4854
(for [runner runners]
49-
(format-stat (stats (repeatedly repeat-count #(second (run-item! runner file))))))))
55+
(format-stat (stats (drop warmup-count (repeatedly (+ warmup-count repeat-count) #(second (run-item! runner file)))))))))
5056

5157
(shutdown-agents)

project.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject uclj "0.1.1-SNAPSHOT"
1+
(defproject uclj "0.1.1"
22
:description "Minimalist and fast Clojure interpreter"
33
:url "https://github.com/erdos/uclj"
44
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"

0 commit comments

Comments
 (0)