js-combinatorics icon indicating copy to clipboard operation
js-combinatorics copied to clipboard

Writing the generated combinations to a file

Open astutesoftware opened this issue 6 years ago • 1 comments

I have generated a billion combinations using this. What is an efficient way to quickly write them to disc. So far i keep running out of memory while using fs methods.

astutesoftware avatar Jan 26 '19 22:01 astutesoftware

I would create a readable stream from the generator of this library and a writable stream from 'fs' then just readable.pipe(writable) assuming you are using nodejs.

The issue is you aren't leaving node any time to flush the suitable stuff to disc.

blanchg avatar Jan 26 '19 22:01 blanchg