Skip to content

Add storage support for uint64 - #3961

Merged
jl-wynen merged 1 commit into
mainfrom
support-uint64-storage
Aug 25, 2026
Merged

jl-wynen merged 1 commit into
mainfrom
support-uint64-storage

Conversation

@jl-wynen

@jl-wynen jl-wynen commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

First step towards #3928 following the plan in #3928 (comment)

This code is taken from the current uint64 branch. I included storage-related code and some basic unary operations and equality between uint64 but not between uint64 and other types.

(I will benchmark compile time and binary size tomorrow.)

Here are some benchmark results. Everything was recorded on my Linux laptop.

Build time

All times are for cold builds of _scipp.so.

Release
New: 2784.86s user 126.29s system 198% cpu 24:24.46 total
Old: 2687.59s user 122.85s system 198% cpu 23:32.64 total
=> new was 97s (3%) slower (user time)

Debug
New: 1894.81s user 122.15s system 392% cpu 8:33.62 total
Old: 1819.51s user 116.94s system 393% cpu 8:12.21 total
=> new was 75s (4%) slower (user time)

Binary size

The total size of all binaries combined in a release build.

New: 58_901_640B
Old: 58_146_432B
=> new is 755kB (1%) larger


I think those increases are acceptable. But I'm not super happy with slowing down releases by ~45s (2 threads) per platform.

Comment on lines +41 to +44
template <> inline constexpr DType dtype<uint64_t>{5};
template <> inline constexpr DType dtype<bool>{6};
template <> inline constexpr DType dtype<std::string>{7};
template <> inline constexpr DType dtype<time_point>{8};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is changing the existing constants a good idea, or is there a risk (serialized, or exchanged via Python) data from different scipp versions becomes incompatible? Why not append in one of the gaps?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how two different scipp versions could interact. We do not expose the underlying int to Python and there is no serialization code in C++.

I opted for this implementation because it keeps the ints contiguous which allows the compiler to optimise checks, e.g., in is_int.

@jl-wynen
jl-wynen marked this pull request as ready for review August 20, 2026 11:30
@jl-wynen
jl-wynen force-pushed the support-uint64-storage branch from b0ea47e to c2a3779 Compare August 25, 2026 12:21
@jl-wynen
jl-wynen enabled auto-merge August 25, 2026 12:22
@jl-wynen
jl-wynen merged commit 29941c1 into main Aug 25, 2026
4 checks passed
@jl-wynen
jl-wynen deleted the support-uint64-storage branch August 25, 2026 13:16
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.

2 participants