Skip to content

Commit

Permalink
use BufferedStreams in bspatch to write new (#32)
Browse files Browse the repository at this point in the history
This mitigates slowness of byte-oriented I/O in Julia ≥ 1.3 by using BufferedStreams when writing the new file.
  • Loading branch information
StefanKarpinski authored Mar 26, 2020
1 parent b31defd commit 513aff7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ authors = ["Stefan Karpinski <[email protected]>"]
version = "1.0.0"

[deps]
BufferedStreams = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
SuffixArrays = "24f65c1e-0a10-5d3d-8a1f-a83399f3fced"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"

[compat]
BufferedStreams = "1"
CodecBzip2 = "0.6, 0.7"
SuffixArrays = "0.3"
TranscodingStreams = "0.9.5"
Expand Down
2 changes: 2 additions & 0 deletions src/BSDiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export bsdiff, bspatch, bsindex
using SuffixArrays
using TranscodingStreams, CodecBzip2
using TranscodingStreams: Codec
using BufferedStreams

# abstract Patch format type
# specific formats defined below
Expand Down Expand Up @@ -197,6 +198,7 @@ function bspatch_core(
new_io::IO,
patch_io::IO,
)
new_io = BufferedOutputStream(new_io)
try
MAGIC = format_magic(format)
magic = String(read(patch_io, ncodeunits(MAGIC)))
Expand Down

0 comments on commit 513aff7

Please sign in to comment.