From 3d535b638667ad0fcfff4246fce61c0176a056c4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 26 Dec 2020 11:54:40 -0800 Subject: fixes #972 Very slow pull/push performance compared to ZMQ This refactors the pipeline protocol to use lightweight mq instead of the more expensive message queue structure. It also provides nicer backpressure and buffering support. The test suite was updated and converted to NUTS as well. This won't completely close the gap, but it should help quite a bit. --- src/core/lmq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/lmq.c b/src/core/lmq.c index bbf42356..47058fc9 100644 --- a/src/core/lmq.c +++ b/src/core/lmq.c @@ -22,7 +22,7 @@ nni_lmq_init(nni_lmq *lmq, size_t cap) // operations as a power of two, for efficiency. It does possibly // waste some space, but never more than 2x. Consumers should try // for powers of two if they are concerned about efficiency. - alloc = 1; + alloc = 2; while (alloc < cap) { alloc *= 2; } @@ -127,7 +127,7 @@ nni_lmq_resize(nni_lmq *lmq, size_t cap) size_t alloc; size_t len; - alloc = 1; + alloc = 2; while (alloc < cap) { alloc *= 2; } -- cgit v1.2.3-70-g09d2