Skip to content

feat: support sparse records (pad and previous-record) - #48

Open
Beforerr wants to merge 1 commit into
mainfrom
push-rumqmxrtvyox
Open

feat: support sparse records (pad and previous-record)#48
Beforerr wants to merge 1 commit into
mainfrom
push-rumqmxrtvyox

Conversation

@Beforerr

Copy link
Copy Markdown
Member

sRecords was parsed but unused; reading a sparse variable crashed with a
TypeError on the first virtual record. Add a sparse read path mirroring
cdflib semantics: pad sparse fills virtual records with the VDR pad value
(or the NASA default pad, which differs from ISTP FILLVAL), prev sparse
repeats the last record of the preceding physical block.

Pad values are read/filled in file encoding so the final byte swap covers
them together with physical data. Fixture generated by test/make_sparse_cdf.py
(cdflib writer); note cdflib's own reader pads only the first element of
multi-element records — we fill the whole record per the CDF IFD.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

sRecords was parsed but unused; reading a sparse variable crashed with a
TypeError on the first virtual record. Add a sparse read path mirroring
cdflib semantics: pad sparse fills virtual records with the VDR pad value
(or the NASA default pad, which differs from ISTP FILLVAL), prev sparse
repeats the last record of the preceding physical block.

Pad values are read/filled in file encoding so the final byte swap covers
them together with physical data. Fixture generated by test/make_sparse_cdf.py
(cdflib writer); note cdflib's own reader pads only the first element of
multi-element records — we fill the whole record per the CDF IFD.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main d7fdac5... main / d7fdac5...
elx/full_load 0.118 ± 0.0041 ms 0.117 ± 0.0039 ms 1.01 ± 0.049
elx/sum_array 3.14 ± 0.39 μs 3.1 ± 0.53 μs 1.01 ± 0.21
elx/sum_lazy 3.25 ± 1 μs 3 ± 0.82 μs 1.08 ± 0.45
elx/sum_var_access 3.85 ± 0.74 μs 3.56 ± 0.55 μs 1.08 ± 0.27
elx/var_access 0.311 ± 0.01 μs 0.301 ± 0.01 μs 1.03 ± 0.048
mms/full_load 27 ± 2.6 μs 27 ± 2.3 μs 1 ± 0.13
mms/sum_array 0.0956 ± 0.0027 s 0.0955 ± 0.015 s 1 ± 0.16
mms/sum_slice 3.58 ± 0.078 ms 3.57 ± 0.082 ms 1 ± 0.032
mms/sum_var_access 3.58 ± 0.05 ms 3.57 ± 0.087 ms 1 ± 0.028
mms/var_access 0.11 ± 0.01 μs 0.11 ± 0.01 μs 1 ± 0.13
time_to_load 0.135 ± 0.0011 s 0.141 ± 0.00017 s 0.956 ± 0.0081
Memory benchmarks
main d7fdac5... main / d7fdac5...
elx/full_load 3.73 k allocs: 0.167 MB 3.73 k allocs: 0.167 MB 1
elx/sum_array 5 allocs: 27.7 kB 5 allocs: 27.7 kB 1
elx/sum_lazy 5 allocs: 27.7 kB 5 allocs: 27.7 kB 1
elx/sum_var_access 8 allocs: 28.1 kB 8 allocs: 28.1 kB 1
elx/var_access 2 allocs: 0.328 kB 2 allocs: 0.328 kB 1
mms/full_load 0.243 k allocs: 14.8 kB 0.243 k allocs: 14.8 kB 1
mms/sum_array 0.524 k allocs: 31.6 MB 0.524 k allocs: 31.6 MB 1
mms/sum_slice 0.045 k allocs: 1.29 MB 0.045 k allocs: 1.29 MB 1
mms/sum_var_access 0.045 k allocs: 1.29 MB 0.045 k allocs: 1.29 MB 1
mms/var_access 2 allocs: 0.328 kB 2 allocs: 0.328 kB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

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