Comments (3)
As far as I understand you want to skip output array resizing at line 1299
If IsArray(OutputTarget) And .Size > 0 Then
ReDim OutputTarget(0 To .Size - 1) As Byte
End If
Another strategy altogether is to implement VFS stream over your oversized buffer with naked pointer arithmetics and all. Check out sample cMemoryStream.cls
for all the VszXxx
function-prototypes (below VFS interface
comment) as expected to be impl by your stream class.
For OutputTarget
I suppose you can even skip VfsReadFile
impl as it will never be called from Extract
. Copy VfsSetFilePointer
and VfsSetEndOfFile
verbatim from cMemoryStream
and VfsWriteFile
boils down to a single CopyMemory
call and m_lPosition
adjustment.
Edit: You can check out cBufferStream
since da52300 for sample impl of the idea above.
from ziparchive.
Many thanks, @wqweto. I didn't expect you to provide a workable sample for me, but your generosity is always a welcome surprise!
(Mostly I find it a little sad when people fork a repo and change many things, but never notify the original code owner of those changes, just in case they find something useful/interesting in it. Of course when the changes are low-quality and potentially dangerous like mine often are, maybe best not mention them... ;)
I will migrate this change to my own copy soon to try and eke a few more ms gain out of loading very large OpenRaster archives. Thank you again.
from ziparchive.
Apologies again for taking so long to revisit this.
After many rounds of perf-testing, the easiest solution proved to be just bypassing the need for .Extract() calls when possible. Most OpenRaster exporters write uncompressed layer PNGs to the zip container - a smart decision, since PNGs are already 90+% deflate'd, and another deflate pass on top gains little but takes forever.
So I just hacked together a small "peek"-like function to return the file offset, compression state, and compressed/original size of individual archive entries. If PNG files are uncompressed in the archive, I can just point the PNG decoder at their offset and parse them directly from disk, skipping the Extract stage entirely.
For the few bad ORA writers who do store deflated PNGs, existing .Extract() function still works fine! I may still drop in the new cBufferStream implementation you so helpfully provided, but profiling shows that time spent in inflate() far outweighs time spent in safearray allocation, so I probably fell victim to "premature optimization is the root of all evil" by targeting allocation perf first. (shrugs sheepishly)
Thank you again for the new example code in cBufferStream. I hope others find it useful too!
from ziparchive.
Related Issues (20)
- Include PuTTY license (just to be safe) HOT 1
- Encryption under VBA HOT 2
- Small changes/features to support OpenRaster spec HOT 7
- ZIP_DEFLATE conditional compilation to mirror ZIP_INFLATE? HOT 3
- Compression file size HOT 3
- Impl dynamic Huffman trees for better compression
- Use libdeflate [de]compressor under conditional compilation HOT 3
- UAC HOT 2
- ConsolePrint not work correctly on CJK HOT 1
- Zip with password is failed HOT 2
- Size of archive exceeds 2GB HOT 5
- Modified date issue HOT 1
- Source of the thunk code HOT 1
- Unzip with password not working HOT 2
- Unzip a file from subfolder of zip, in a folder without subfolder HOT 2
- Get file zip from zip archive ?
- Size limits ? Not all files are archived HOT 2
- Extract File From Resource File HOT 7
- Extracted files Date and Time changed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ziparchive.