Repository navigation
Decompress snappy into a bytearray - #153
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 31 31
Lines 2180 2179 -1
=====================================
+ Misses 2180 2179 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 56.93%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing |
Since fox-it#148, snappy releases its memoryview slice with a with statement, so every match pays for two context managers, and CodSpeed measures the snappy benchmarks 12 to 28% slower. A bytearray needs no memoryview: a match is a plain slice of the output, so there is no export left for PyPy's GC to release before the output grows. The large benchmark takes 85 us on CPython 3.13, down from 157 us now and 116 us before fox-it#148, and 16 us on PyPy 8.0.1, down from 265 us. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJvjcGbjsG74UunzfT5zNE
2430557 to
c1aa3ee
Compare
snappy.decompresswrites into abytearrayinstead of aBytesIO, so it needs nomemoryviewat all. The PyPy export problem #148 fixed can't occur, and the slowdown since #148 is gone:largebenchmarkTested with
tox -e lint,3.10,3.11,3.13,pypy3.10,pypy3.11,benchmarkon Linux.Closes #152
🤖 Generated with Claude Code
https://claude.ai/code/session_01HJvjcGbjsG74UunzfT5zNE