diff caching-tests/bench.ur @ 2292:23eaec04e0f8

Ran a benchmark!
author Ziv Scully <ziv@mit.edu>
date Tue, 17 Nov 2015 04:08:12 -0500
parents ab6ca12debeb
children 8be54d7bd06e
line wrap: on
line diff
--- a/caching-tests/bench.ur	Tue Nov 17 02:44:37 2015 -0500
+++ b/caching-tests/bench.ur	Tue Nov 17 04:08:12 2015 -0500
@@ -3,6 +3,7 @@
 fun check id =
     res <- oneOrNoRows (SELECT tab.Val FROM tab WHERE tab.Id = {[id]});
     return <xml><body>
+      cache
       {case res of
            None => <xml>?</xml>
          | Some row => <xml>{[row.Tab.Val]}</xml>}
@@ -13,12 +14,3 @@
     return <xml><body>
       Changed {[id]}!
     </body></xml>
-
-fun main x y =
-    r <- rand;
-    let
-        val id = r % x
-        val doFlush = (r / x) % y = 0
-    in
-        if doFlush then flush id else check id
-    end