Closed ronag closed 2 years ago
Would be nice if multileveldown provided a less hacky way to do this...
The goal here is to skip this line, if I understand it correctly? https://github.com/Level/multileveldown/blob/52f4861fc37500bfed167114f007bfce3104fc77/leveldown.js#L79.
The goal here is to skip this line, if I understand it correctly? https://github.com/Level/multileveldown/blob/52f4861fc37500bfed167114f007bfce3104fc77/leveldown.js#L79.
Yep and avoid the overhead and complexity of an intermediate stream.
The less hacky way would be to support a second argument here, defaulting to null:
The less hacky way would be to support a second argument here, defaulting to null:
Yep. But that would require updating multileveldown.
I worry this will have a side effects, because:
duplexify
handles a bunch of edge casesclose
event on a net socket has a hadError
argument that we may need to ignore hereI worry this will have a side effects, because:
duplexify
handles a bunch of edge cases
I'm more worried about having duplexify than not having it.
- the
close
event on a net socket has ahadError
argument that we may need to ignore here
Yes.
This makes no difference in my benchmarks, at least not after removing much bigger bottlenecks. In rave-level
(the WIP replacement for level-party
) I doubled the throughput by batching reads, among other things.
Can I follow many-level somewhere?
I'll post something in https://github.com/Level/abstract-level/issues/14 once I've pushed the repo
Bypasses duplexify and pipes encode, socket, decode directly without any intermediate proxy.