Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
d@nny disc@ mc²
d@nny disc@ mc²
@hipsterelectron@circumstances.run  ·  activity timestamp 2 months ago
 let uncompressed_size = data.uncompressed_size as usize;
/* We already know *exactly* how many bytes we will need to read out
* (because this info is recorded in the zip file entryu), so we can
* allocate exactly that much to minimize allocation as well as
* blocking on memory availability for the decompressor. */

they literally don't want you to know this about zip files

  • Copy link
  • Flag this post
  • Block
d@nny disc@ mc²
d@nny disc@ mc²
@hipsterelectron@circumstances.run  ·  activity timestamp 2 months ago

/* (4) In order, scan off the raw memory for every file entry into a Box<[u8]> to avoid
* interleaving decompression with read i/o. */

this one comment is literally the entire game if anyone would listen to me

  • Copy link
  • Flag this comment
  • Block
Federation Bot
Federation Bot
@Federation_Bot  ·  activity timestamp 2 months ago

lmao a literal word-for-word async implementation of the zip file spec that i completely forgot i did. i think that bumps the count to 4 times i've implemented the zip spec https://github.com/cosmicexplorer/zip/blob/f755697eff4f342c842e2c76ae2bb387515de56b/src/tokio/read.rs#L1102 i guess it would be hard for astral without that expertise

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.32 no JS en
Federation disabled
Log in
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct