Skip to content

Make GeoLite2 file decompression memory efficient - #73

Merged
acelaya merged 2 commits into
shlinkio:mainfrom
acelaya-forks:feature/memory-efficient-decompression
Sep 11, 2025
Merged

acelaya merged 2 commits into
shlinkio:mainfrom
acelaya-forks:feature/memory-efficient-decompression

Conversation

@acelaya

@acelaya acelaya commented Sep 10, 2025

Copy link
Copy Markdown
Member

Closes #71

Refactor logic to decompress a GeoLite2 db file once it has been downloaded, so that we don't try to load the whole file in memory, but do it in chunks instead.

This ensures Shlink does not crash if the amount of memory reserved for it is lower than the GeoLite db file size.

@codecov

codecov Bot commented Sep 10, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.64%. Comparing base (44c4c06) to head (0929c2d).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/File/MemoryEfficientFileExtractor.php 95.23% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #73      +/-   ##
============================================
- Coverage     97.02%   96.64%   -0.39%     
- Complexity       36       50      +14     
============================================
  Files            11       13       +2     
  Lines           101      149      +48     
============================================
+ Hits             98      144      +46     
- Misses            3        5       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acelaya
acelaya force-pushed the feature/memory-efficient-decompression branch from 5298cd5 to 2212ab0 Compare September 10, 2025 06:55
@acelaya
acelaya merged commit 7af1a19 into shlinkio:main Sep 11, 2025
7 of 8 checks passed
@acelaya
acelaya deleted the feature/memory-efficient-decompression branch September 11, 2025 06:49
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.

Try to buffer decompressing and moving of geolite file

1 participant