Skip to content

Instantly share code, notes, and snippets.

@w01fe
Created October 1, 2012 02:44
Show Gist options
  • Save w01fe/3809199 to your computer and use it in GitHub Desktop.
Save w01fe/3809199 to your computer and use it in GitHub Desktop.
Fancier Graph compilation examples
(def lazy-stats (graph/lazy-compile stats-graph))
(:m (lazy-stats {:xs [1 2 3 6]}))
; ==> 3
; WIN: :m2 and :v are not computed.
(def par-stats (graph/parallel-compile stats-graph))
(:v (par-stats {:xs [1 2 3 6]}))
; ==> 3.5
; WIN: :m and :m2 are computed in parallel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment