aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-20 11:42:13 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-20 11:42:13 +0200
commitbb09e52a7481718ae1fe324d16b99970450908f8 (patch)
tree8cc9e34b629eed7e04e2a067ac9747fe20eea81d /src/solvers/h48
parent89e0bc567960199dec774e5449e471dd31ef440b (diff)
downloadnissy-core-bb09e52a7481718ae1fe324d16b99970450908f8.tar.gz
nissy-core-bb09e52a7481718ae1fe324d16b99970450908f8.zip
Added comment on performance issue
Diffstat (limited to 'src/solvers/h48')
-rw-r--r--src/solvers/h48/gendata_h48.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index a993f53..3445570 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -284,6 +284,19 @@ gendata_h48h0k4_return_size:
284 return H48_TABLESIZE(0, 4) + INFOSIZE; 284 return H48_TABLESIZE(0, 4) + INFOSIZE;
285} 285}
286 286
287/*
288TODO: the following function suffers from a big performance loss (about 40%)
289because of all the mutex locking. It is possible to reduce the first lock
290(at the beginning of the outermost for loop) by caching the next few items at
291once and then looping over the cached elements. But for the second one (inner
292loop) the access is non-sequential, so this cannot be done.
293
294However, in both cases in theory we do not care if we are reading the old
295value or the updated one. Depending on the compiler guarantees on concurrent
296memory access, we may be fine just removing the locks altogether.
297
298It is probably possible to solve part of this by using atomics.
299*/
287STATIC void * 300STATIC void *
288gendata_h48h0k4_runthread(void *arg) 301gendata_h48h0k4_runthread(void *arg)
289{ 302{

Generated with cgit - Back to sebastiano.tronto.net