-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pledgeinsize
#64
base: master
Are you sure you want to change the base?
Add pledgeinsize
#64
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #64 +/- ##
==========================================
+ Coverage 61.35% 63.56% +2.21%
==========================================
Files 5 5
Lines 370 376 +6
==========================================
+ Hits 227 239 +12
+ Misses 143 137 -6 ☔ View full report in Codecov by Sentry. |
@@ -31,6 +31,7 @@ jobs: | |||
Pkg.Registry.update() | |||
Pkg.activate(;temp=true) | |||
# force it to use this PR's version of the package | |||
ENV["JULIA_PKG_DEVDIR"]= mktempdir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures fresh versions of the developed packages, in case this is run locally.
end | ||
|
||
function TranscodingStreams.process(codec::ZstdCompressor, input::Memory, output::Memory, error::Error) | ||
if codec.cstream.ptr == C_NULL | ||
error("startproc must be called before process") | ||
Base.error("`startproc` must be called before `process`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error
is the name of a local variable, so I need to specify Base.error
here.
s = TranscodingStream(codec(), sink; stop_on_end=true) | ||
write(s, b"Hello") | ||
close(s) | ||
buffer3 = take!(sink) | ||
@test CodecZstd.find_decompressed_size(buffer3) == CodecZstd.ZSTD_CONTENTSIZE_UNKNOWN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transcode
with ZstdCompressor
now records the decompressed size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Julia functions should not return error codes. They should throw exceptions.
This is part of JuliaIO/TranscodingStreams.jl#239
This PR reduces the allocations needed when decompressing data compressed with
transcode
.For example:
With this PR and JuliaIO/TranscodingStreams.jl#239:
416.579 ns (4 allocations: 10.05 KiB)
Before:
510.451 ns (5 allocations: 19.72 KiB)