aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-12-26 11:54:40 -0800
committerGarrett D'Amore <garrett@damore.org>2020-12-27 17:26:19 -0800
commit3d535b638667ad0fcfff4246fce61c0176a056c4 (patch)
treeec9b5054885e3898ac0f5f3ed203ab49534d11bb /src/core
parentc3bfec2b38caaf34379a891e0ea30c7e48147c6f (diff)
downloadnng-3d535b638667ad0fcfff4246fce61c0176a056c4.tar.gz
nng-3d535b638667ad0fcfff4246fce61c0176a056c4.tar.bz2
nng-3d535b638667ad0fcfff4246fce61c0176a056c4.zip
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.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lmq.c4
1 files changed, 2 insertions, 2 deletions
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;
}