zip.js seekEOCDR running slow on chrome #244
Unanswered
udaymandava
asked this question in
Q&A
Replies: 2 comments 9 replies
-
Besides the fact that the file weighs 2.7 GB, is there anything else specific about this scenario? How many entries does the zip file contain? |
Beta Was this translation helpful? Give feedback.
9 replies
-
When I run the code below on my machine in Chrome, I see that https://jsfiddle.net/cj3szr7e/ /* eslint-disable no-console */
/* global zip, document, Blob, setTimeout, Intl, URL, alert, console */
"use strict";
document.body.innerHTML = "Creating zip file..." + "<br>";
test().catch(error => console.error(error));
async function test() {
const blobWriter = new zip.BlobWriter("application/zip");
const zipWriter = new zip.ZipWriter(blobWriter);
const promises = [];
const max = 2000;
const data = new Uint8Array(1500 * 1024);
for (let indexBlob = 0; indexBlob < max; indexBlob++) {
const reader = new zip.Uint8ArrayReader(data);
const promiseAdd = zipWriter.add("test_" + indexBlob, reader, { level: 0 });
promises.push(promiseAdd);
}
await Promise.all(promises);
await zipWriter.close();
const blob = blobWriter.getData();
const zipReader = new zip.ZipReader(new zip.BlobReader(blob));
document.body.innerHTML += "File size: " + new Intl.NumberFormat().format(blob.size) + " bytes<br>";
document.body.innerHTML += "Download zip file".link(URL.createObjectURL(blob)) + "<br>";
alert("Click OK to launch the test");
document.body.innerHTML += "Read entries..<br>";
const startTime = Date.now();
const entries = await zipReader.getEntries();
document.body.innerHTML += "Result: " + (Date.now() - startTime) + "ms<br>";
document.body.innerHTML += "Number of files: " + new Intl.NumberFormat().format(entries.length) + "<br>";
await zipReader.close();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i have scenario where I am uploading 2.7 GB file Chrome & Edge browser take around 10 mins to read the contents of the file where as on FF it is taking around 2 mins. This happens for most of the users.. any specific things to check for these users?
Beta Was this translation helpful? Give feedback.
All reactions