Skip to content

Change pixels vector to tuple in fits_read_pix#83

Draft
jishnub wants to merge 1 commit intomasterfrom
jishnub/readones
Draft

Change pixels vector to tuple in fits_read_pix#83
jishnub wants to merge 1 commit intomasterfrom
jishnub/readones

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented May 27, 2025

This was changed in v1.7.1 as using a Vector instead of a Tuple improves type-stability, but since there is a function barrier, the instability does not appear to matter for performance. Using a Tuple leads to zero allocations, even though this introduces a type-instability.

julia> @btime fits_read_pix($f, $A); # vector
  147.441 ns (2 allocations: 80 bytes)

julia> @btime fits_read_pix($f, $A); # tuple
  139.501 ns (0 allocations: 0 bytes)

Opening this PR to discuss what people prefer.

Alternately, we may define a custom Ones vector implementation analogous to FillArrays, which would be type-stable as well as allocation-free.

@codecov
Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.27%. Comparing base (b8cc1f0) to head (33a4eb9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #83   +/-   ##
=======================================
  Coverage   95.27%   95.27%           
=======================================
  Files           1        1           
  Lines         889      889           
=======================================
  Hits          847      847           
  Misses         42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jishnub jishnub marked this pull request as draft June 4, 2025 06:43
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

Successfully merging this pull request may close these issues.

1 participant