Skip to content
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

Further support for IO objects #19

Closed
kimikage opened this issue May 29, 2024 · 3 comments
Closed

Further support for IO objects #19

kimikage opened this issue May 29, 2024 · 3 comments

Comments

@kimikage
Copy link
Contributor

I don't understand the history of this package, but this package handles Vector{UInt8} at a low level.
However, much of what this package does should already be provided at a high level by IO objects such as IOBuffer.

@kimikage
Copy link
Contributor Author

Inflate.jl/src/Inflate.jl

Lines 255 to 263 in ed24b32

length = getlength(data, v)
distance = getdist(data)
if length <= distance
append!(out, @view out[(end - distance + 1):(end - distance + length)])
else
for i = 1:length
push!(out, out[end - distance + 1])
end
end

One of the performance bottlenecks is the append! there. Handling variable length data is what IOBuffer is good at.

@GunnarFarneback
Copy link
Owner

This is the history: https://gist.github.com/GunnarFarneback/8254567

It was initially written ten years ago for Julia 0.2 because at the time it was too difficult to get libz working for Windows and it was much easier to write a Julia implementation. It was later converted to a package and the streaming support was added when LightGraphs wanted to make use of it.

@kimikage
Copy link
Contributor Author

I showed an example of using IO objects in PR#22.
We can re-open this.

@kimikage kimikage closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
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

No branches or pull requests

2 participants