datacrypt-project / hitchhiker-tree

Functional, persistent, off-heap, high performance data structure
Eclipse Public License 1.0
1.19k stars 64 forks source link

bootifying the tree #7

Closed tolitius closed 8 years ago

tolitius commented 8 years ago

bench is not exactly a "regular" build task, but nothing boot can't handle :)

Building a Jar

[tolitius:..playground/hitchhiker-tree]$ boot pom jar                                                                                     
Writing pom.xml and pom.properties...
Writing hitchhiker-tree-0.1.0-SNAPSHOT.jar...

Benching

$ boot bench --args "perf_diff_experiment -b 10 -- -b 42"

What's with "--args"?

notice --args. there are multiple ways to pass runtime args, but one thing to note boot stays true to tasks whether you run them from command line, REPL, within build.boot, etc.. and the format is "task options". Those options a types, so we can pass args as a Clojure map for example, but I did not want to change the String expectation that is already in the bench/-main

String args vs. Clojure map

In reality, bench could be just a function that takes a Clojure map as args, and in case we do need -main, we can have it parse the String args. This way boot and any other Clojure function can call it directly with just a map.

[tolitius:..playground/hitchhiker-tree]$ boot bench --args "perf_diff_experiment -b 10 -- -b 42"                                           
Doing fractal__flush_1000__b_10__testing__n_100000__del_forward_in-order
Doing fractal__flush_1000__b_10__testing__n_100000__del_forward_random
Doing fractal__flush_1000__b_42__testing__n_100000__del_forward_in-order
Doing fractal__flush_1000__b_42__testing__n_100000__del_forward_random

TravisCI

It is running as:

$ export TEST_CMD='lein bench output --data-structure fractal -- --data-structure b-tree -- --data-structure sorted-set'

Boot can too:

[tolitius:..playground/hitchhiker-tree]$ boot bench -a "output --data-structure fractal -- --data-structure b-tree -- --data-structure sorted-set"
Doing fractal__flush_1000__b_300__testing__n_100000__del_forward_in-order
Doing fractal__flush_1000__b_300__testing__n_100000__del_forward_random
Doing b-tree__flush_1000__b_300__testing__n_100000__del_forward_in-order
Doing b-tree__flush_1000__b_300__testing__n_100000__del_forward_random
Doing sorted-set__flush_1000__b_300__testing__n_100000__del_forward_in-order
Doing sorted-set__flush_1000__b_300__testing__n_100000__del_forward_random
dgrnbrg commented 8 years ago

Somehow, these aren't currently running the user-space code. We need to fix that to merge.

dgrnbrg commented 8 years ago

Do you think you're going to have a chance to solve the issue where this isn't running the tests? I'd love to switch to boot.

tolitius commented 8 years ago

hey, most likely won't have time. project can continue using lein and could switch to boot at any time later on, if that'd be still needed.

dgrnbrg commented 8 years ago

Closing for now.