emscripten-core / emscripten-core/emscripten
Support Uint8Array instances as Module.stdin and as Module's stdout/stderr
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Overriding Module.stdin and doing an iterator works, but is very slow for large-ish inputs:
```js
stdin()
{
if(Module.input_stdin_binary.length == 0)
return null;
const ord = Module.input_stdin_binary[0];
Module.input_stdin_binary = Module.input_stdin_binary.slice(1);
return ord;
},
```
I'm using this to calculate sha1 hash with busybox's sha1sum. I'm comparing providing file contents as stdin and calling sha1sum versus saving the contents to a temp file and calling sha1sum. The first is so much slower - probably for no good reason
Contributor guide
Assessment
This issue has not been assessed yet.