Skip to content

What does bufferedWrite do? #249

Answered by gildas-lormeau
gera2ld asked this question in Q&A
Discussion options

You must be logged in to vote

When bufferedWrite is set to true, zip.js creates a separate buffer for each entry being created to avoid data corruption in the zip file. However, when it's set to false, zip.js can still detect if ZipWriter#add is called in parallel and create automatically the buffers if necessary. In this case, the entry added via the first call to ZipWriter#add is blocking because zip.js did not know there would be concurrent writes. So the performance depends on the size of the first entry added in the zip. That's the reason why you should set bufferedWrite to true when you know you will call ZipWriter#add multiple times in parallel. Any value is safe though.
Finally, note that the option keepOrder

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by gildas-lormeau
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #236 on May 19, 2021 00:07.