aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/linda_perf.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/linda_perf.lua b/tests/linda_perf.lua
index fa40bcb..0b25989 100644
--- a/tests/linda_perf.lua
+++ b/tests/linda_perf.lua
@@ -1,5 +1,5 @@
1local lanes = require "lanes" 1local config = {nb_user_keepers=1}
2lanes.configure{ with_timers = false } 2local lanes = require "lanes".configure(config)
3 3
4-- set TEST1, PREFILL1, FILL1, TEST2, PREFILL2, FILL2 from the command line 4-- set TEST1, PREFILL1, FILL1, TEST2, PREFILL2, FILL2 from the command line
5 5
@@ -82,11 +82,14 @@ local lane_gobbler_gen = lanes.gen( "*", {priority = 3}, gobbler)
82 82
83-- ################################################################################################# 83-- #################################################################################################
84 84
85local group_uid = 1
86
85-- main thread writes data while a lane reads it 87-- main thread writes data while a lane reads it
86local function ziva1( preloop, loop, batch) 88local function ziva1( preloop, loop, batch)
87 -- prefill the linda a bit to increase fifo stress 89 -- prefill the linda a bit to increase fifo stress
88 local top = math.max( preloop, loop) 90 local top = math.max( preloop, loop)
89 local l = lanes.linda("ziva1("..preloop..":"..loop..":"..batch..")") 91 local l = lanes.linda("ziva1("..preloop..":"..loop..":"..batch..")", group_uid)
92 group_uid = (group_uid % config.nb_user_keepers) + 1
90 local t1 = lanes.now_secs() 93 local t1 = lanes.now_secs()
91 for i = 1, preloop do 94 for i = 1, preloop do
92 l:send( "key", i) 95 l:send( "key", i)
@@ -160,7 +163,8 @@ end
160 163
161-- sequential write/read (no parallelization involved) 164-- sequential write/read (no parallelization involved)
162local function ziva2( preloop, loop, batch) 165local function ziva2( preloop, loop, batch)
163 local l = lanes.linda("ziva2("..preloop..":"..loop..":"..tostring(batch)..")") 166 local l = lanes.linda("ziva2("..preloop..":"..loop..":"..tostring(batch)..")", group_uid)
167 group_uid = (group_uid % config.nb_user_keepers) + 1
164 -- prefill the linda a bit to increase fifo stress 168 -- prefill the linda a bit to increase fifo stress
165 local top, step = math.max( preloop, loop), (l.batched and batch) and batch or 1 169 local top, step = math.max( preloop, loop), (l.batched and batch) and batch or 1
166 local batch_send, batch_read 170 local batch_send, batch_read