-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use Vector{Vector{UInt8}} instead of Vector{AbstractVector{UInt8}} in… #3
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3 +/- ##
==========================================
+ Coverage 94.11% 95.55% +1.43%
==========================================
Files 2 2
Lines 85 90 +5
==========================================
+ Hits 80 86 +6
+ Misses 5 4 -1
Continue to review full report at Codecov.
|
Trying to measure on the proxy process instead:
to
but measurements seem very noisy... |
4f995e3
to
c4c0e63
Compare
The second commit takes julia> function perf()
buf = BufferStream()
@sync begin
@async begin
for i in 1:1024
write(buf, rand(UInt8, 1024))
end
close(buf)
end
@async begin
write(devnull, buf)
end
end
end
perf (generic function with 1 method) from julia> @btime perf();
835.635 μs (10282 allocations: 2.53 MiB) to julia> @btime perf();
819.363 μs (8235 allocations: 2.50 MiB) |
Hmm, it seems like this undoes #1 but I can not see where anything but |
What do you mean by it un-does it? |
The |
But I guess that wasn't needed since tests still pass here. |
I'm not convinced that your benchmarks actually show a speedup? |
The speedup, although small (2%), is consistent between runs atleast, and also 20% reduction of allocations. It just seems nice to be type-stable when it is such a small change. |
c4c0e63
to
ea002cb
Compare
The |
Am I reading your table of benchmarks backwards? It looks to me like allocations go up from 15.5GB to 16.0GB. |
Oh, you are talking about #3 (comment) I was talking about these benchmarks: #3 (comment) |
Right, the second commit makes more sense to me than the first. I'm specifically wondering if the first commit actually helps at all. |
Use
Vector{Vector{UInt8}}
instead ofVector{AbstractVector{UInt8}}
inBufferStream
.This cuts down the benchmark in JuliaWeb/HTTP.jl#662 from
to