From 72f3189f2518590c64681a8eea513abd192ed836 Mon Sep 17 00:00:00 2001 From: Jorge Acereda Date: Fri, 20 Sep 2019 23:40:05 +0200 Subject: [PATCH] Fix map and structs benchmarks. --- bench/map.carp | 16 ++++++++-------- bench/structs.carp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bench/map.carp b/bench/map.carp index 0bc8acde..93105214 100644 --- a/bench/map.carp +++ b/bench/map.carp @@ -4,21 +4,21 @@ (defn insert [] (let [m {}] (for [i 0 100] - (set! m (Map.put &m &i &1))))) + (Map.put! &m &i &1)))) (defn insert-collisions [] (let [m (Map.create-with-len 1)] (for [i 0 100] - (set! m (Map.put &m &1 &1))))) + (Map.put! &m &1 &1)))) (def m (the (Map Int Int) {})) (defn single-insert [] - (set! m (Map.put &m &1 &1))) + (Map.put! &m &1 &1)) (defn setup-big-map [] (for [i 0 10000] - (set! m (Map.put &m &i &1)))) + (Map.put! &m &i &1))) (defn retrieve [] (Map.get &m &10)) @@ -52,21 +52,21 @@ (defn insert-set [] (let [m (Set.create)] (for [i 0 100] - (set! m (Set.put &m &i))))) + (Set.put! &m &i)))) (defn insert-set-collisions [] (let [m (Set.create-with-len 1)] (for [i 0 100] - (set! m (Set.put &m &i))))) + (Set.put! &m &i)))) (def s (the (Set Int) (Set.create))) (defn single-insert-set [] - (set! s (Set.put &s &1))) + (Set.put! &s &1)) (defn setup-big-set [] (for [i 0 10000] - (set! s (Set.put &s &i)))) + (Set.put! &s &i))) (defn contains-set [] (Set.contains? &s &10)) diff --git a/bench/structs.carp b/bench/structs.carp index 8dc85a8d..bed60a90 100644 --- a/bench/structs.carp +++ b/bench/structs.carp @@ -8,7 +8,7 @@ (defn creation [] (Point.init 0 0)) (defn bench-access [] (ignore (Point.x &p))) ;; The name 'access' collides with an existing C-function. (defn set [] (Point.set-x @&p 5)) -(defn update [] (Point.update-x @&p Int.inc)) +(defn update [] (Point.update-x @&p &Int.inc)) (defn main [] (do