Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro defcomparisontest
- "Define a GReQL/FunQL comparison test with name n on graph g that asserts the
- equality of the results evaluating greql and funql."
- [n g greql funql]
- `(deftest ~n
- ~g ;; ensure the graph is loaded, if it is given as memoized function.
- (println "####################################################")
- (println "Comparison test:" ~(name n))
- (is (=
- (do
- (print "GReQL evaluation time:")
- (jvalue-unpack (time (greql-eval ~g ~greql))))
- (do
- (print "FunQL evaluation time:")
- ;; Ensure that we realize LazySeqs completely, to get a fair
- ;; timing.
- (time (let [r# ~funql]
- (if (instance? clojure.lang.LazySeq r#)
- (doall r#)
- r#))))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement