Closed jishnub closed 2 years ago
After https://github.com/JuliaAstro/FITSIO.jl/pull/167/commits/73408ee2471443b3a4493b095f44d31a89e4cfd7 there are no allocations in write
:
julia> f = FITS(tempname(), "w");
julia> a = Float64[1 3; 2 4];
julia> @btime write($f, $a);
25.898 μs (0 allocations: 0 bytes)
julia> hdu = f[1];
julia> @btime write($hdu, $a);
235.786 ns (0 allocations: 0 bytes)
Merging #167 (b21e4a8) into master (3ec2708) will not change coverage. The diff coverage is
100.00%
.:exclamation: Current head b21e4a8 differs from pull request most recent head 2a24db0. Consider uploading reports for the commit 2a24db0 to get more accurate results
@@ Coverage Diff @@
## master #167 +/- ##
=======================================
Coverage 91.20% 91.20%
=======================================
Files 5 5
Lines 614 614
=======================================
Hits 560 560
Misses 54 54
Impacted Files | Coverage Δ | |
---|---|---|
src/image.jl | 94.89% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3ec2708...2a24db0. Read the comment docs.
Test failure in building the documentation is likely due to https://github.com/JuliaRegistries/General/issues/16777. I've seen this happen if the compat
version of a dependency is bumped.
This PR relies on https://github.com/JuliaAstro/CFITSIO.jl/pull/8, so tests will only pass with that PR merged and a version tagged.
On master and using the latest tagged CFITSIO:
After this PR:
With this, in-place read becomes allocation-free:
On master and using the latest tagged CFITSIO:
After this PR:
Even with non-inferred code and runtime dispatch, performance seems identical and there are no allocations:
One may of course help with the inference if the
eltype
andndim
is known: