diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-10 09:57:47 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-10 09:57:47 +0200 |
commit | d93e1fcea482f8348bb42171befea08466f8541f (patch) | |
tree | 885952cd1de3f4b7d923f61ba3cdf2b358749483 /tests | |
parent | 9a7c7f5f7ec66576447b4d225066cc388f8ca6b0 (diff) | |
download | lanes-d93e1fcea482f8348bb42171befea08466f8541f.tar.gz lanes-d93e1fcea482f8348bb42171befea08466f8541f.tar.bz2 lanes-d93e1fcea482f8348bb42171befea08466f8541f.zip |
Suspend/resume GC around Linda operations
Diffstat (limited to 'tests')
-rw-r--r-- | tests/linda_perf.lua | 12 |
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 @@ | |||
1 | local lanes = require "lanes" | 1 | local config = {nb_user_keepers=1} |
2 | lanes.configure{ with_timers = false } | 2 | local 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 | ||
85 | local group_uid = 1 | ||
86 | |||
85 | -- main thread writes data while a lane reads it | 87 | -- main thread writes data while a lane reads it |
86 | local function ziva1( preloop, loop, batch) | 88 | local 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) |
162 | local function ziva2( preloop, loop, batch) | 165 | local 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 |