Skip to content

Remove unneeded full data copy - #8

Open
UgnilJoZ wants to merge 2 commits into
kassoulet:mainfrom
UgnilJoZ:fix/unnecessary-copy
Open

UgnilJoZ wants to merge 2 commits into
kassoulet:mainfrom
UgnilJoZ:fix/unnecessary-copy

Conversation

@UgnilJoZ

@UgnilJoZ UgnilJoZ commented Sep 8, 2026 •

Copy link
Copy Markdown

While reading a Wikidata dump with Bz2Decoder::open from parallel_bzip2_decoder, I noticed my program tried to reserve 96 GiB of memory. The reason for that is that the crate copies the full memory-mapped file into the heap while scanning for blocks, which negates the advantage of using mmap. Removing the copy lets the crate behave as expected. Unfortunately I had to modify the signature of scan_blocks, which is a breaking change.

@UgnilJoZ
UgnilJoZ force-pushed the fix/unnecessary-copy branch from 23565a3 to 7ee5eec Compare September 8, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant