mdarray: Apply no_unique_address optimization to members of mdarray
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 507
- Forks
- 87
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 2
Description
@johan-overbye reports that:
mdarrays with all static extents seem to require an extra 4 bytes on top of the container. (Latest MSVC for x86-64 with/std:c++latest.)
The reference implementation of mdarray doesn't currently use any of various techniques (such as [[no_unique_address]]) for not using space for members with no data,
but the reference implementation of mdspan uses a "compressed pair" abstraction for this purpose.
We should consider using this abstraction for mdarray as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/experimental/__p1684_bits/mdarray.hpp around line 454, then compare the compressed-pair abstraction and its uses in include/experimental/__p0009_bits/mdspan.hpp around lines 116 and 380. Determine whether that abstraction can be applied to mdarray; done means static-extents mdarrays avoid the reported extra storage without changing their intended behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100