-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow results of createReadStream in the browser #21
Comments
Might be due to the use of |
I'm going to check that. |
You might also be interested in Level/community#70 |
ahh nice, I did something similar in hypercore holepunchto/hypercore#261 It really improves the performance of reading. |
You right, I removed the setImmediate in the memdown iterator and the performance increased. Of course is not a soluton, just checking. What I don't understand is that the I will keep checking, thanks! |
Ok AbstractLevelDOWN iterator works great and the performance is about |
Thanks @vweevers it was what you said, the Stream interface doing a nextTick for the internal I try doing this to check and the performance result was really impresive: const queueMicrotask = require('queue-microtask');
if (typeof window !== 'undefined') {
process.nextTick = function (fn) {
var args = new Array(arguments.length - 1)
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i]
}
}
queueMicrotask(() => fn(...args))
}
}
|
|
Hi @vweevers, how are you?
I found something weird using level-mem (or level too) and createReadStream in the browser.
createReadStream
in the browser takes4 seconds
to read1000
elements but for example if I read the items one by one usingget
the performance increase. This is only happening in the browser.I did a repository with my test: https://github.com/tinchoz49/level-bench
Results in my machine:
Node
Browser
The text was updated successfully, but these errors were encountered: