Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2846 R6 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges #1549

Open
wg21bot opened this issue May 26, 2023 · 12 comments
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges size - medium paper size estimate
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented May 26, 2023

P2846R0 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot added the SG9 Ranges SG label May 26, 2023
@wg21bot wg21bot added this to the 2023-telecon milestone May 26, 2023
@inbal2l
Copy link
Collaborator

inbal2l commented Jul 10, 2023

SG9 (Ranges) reviewed P846R0 during the Varna meeting on 2023-06-12 (Full Minutes).

Polls

POLL: The standard needs to clearly define where size_hint should be called

SF F N A SA
0 2 0 3 2

Outcome: Weak consensus against

# Of Authors: 1

Author’s Position: WF

Attendance: 9

WF: We’re unsure what’s the recommendation (both said “very weakly in favor”)

SA: Performance hints should be hints


POLL: Prefer approximate_size over size_hint (for consistency with the concept name, approximately_sized_range)

F N A
3 2 2

Outcome: No consensus

# Of Authors: 1

Author’s Position: F

Attendance: 9


POLL: Modify the paper to include suggested guidance, make sized_range to subsume approximately_sized_range (assuming non breaking change), and forward “P2846R0: size_hint: Eagerly reserving memory for not-quite-sized lazy ranges” to LEWG for C++26.

SF F N A SA
3 3 1 0 0

Attendance: 9

# of Authors: 1

Author Position: SF

Outcome: Strong Consensus in Favour

Summary

The paper needs to apply the following updates:

  1. Capture the implementation options (includes: mandating a call to size_hint (taking side effects into consideration), defining loosened requirements without mandating the use, or allowing implementations to ignore size_hint) - to be determined by LEWG
  2. rename size_hint to: approximately_sized_range

And move the revised paper to LEWG for C++26

@inbal2l inbal2l added LEWG Library Evolution needs-revision Paper needs changes before it can proceed C++26 Targeted at C++26 and removed SG9 Ranges SG labels Jul 10, 2023
@inbal2l inbal2l added the IS Ship vehicle: IS label Jul 31, 2023
@wg21bot
Copy link
Collaborator Author

wg21bot commented Sep 18, 2023

P2846R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Sep 18, 2023
@wg21bot wg21bot changed the title P2846 R0 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges Sep 18, 2023
@inbal2l inbal2l added ranges std::ranges B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e size - medium paper size estimate ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting labels Sep 24, 2023
@inbal2l inbal2l added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Oct 14, 2023
@inbal2l inbal2l changed the title P2846 R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges (A) Oct 18, 2023
@inbal2l inbal2l changed the title P2846 R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges (A) P2846 R1 size_hint: Eagerly reserving memory for not-quite-sized lazy ranges Oct 19, 2023
@inbal2l inbal2l removed the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Nov 20, 2023
@inbal2l inbal2l added the scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review label Jan 5, 2024
@ben-craig
Copy link

2024-01-16 Library Evolution Telecon

P2846R1: size_hint: Eagerly reserving memory for not-quite-sized lazy ranges

2024-01-16 Library Evolution Telecon Minutes

Champion: Corentin Jabot

Chair: Ben Craig

Minute Taker: Mark Hoemmen

Summary

POLL: P2846 (size_hint: Eagerly reserving memory for not-quite-sized lazy ranges) needs max, min and approximate facilities, and not just a single number.

SF F N A SA
1 0 4 4 7

Attendance: 18

# of Authors: 1

Author's Position: SA

Outcome: Consensus against

Next Steps

Research idea of unconditional size hint on views like take

Discuss some of the names brought up in the meeting, reserve_hint, min_reserve

Next time, look at modifications, consider impl defined or otherwise for vector's use of sized hint, then look at wording.

@inbal2l inbal2l added needs-revision Paper needs changes before it can proceed and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jan 17, 2024
@jensmaurer jensmaurer removed this from the 2023-telecon milestone Mar 19, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented May 22, 2024

P2846R2 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label May 22, 2024
@wg21bot wg21bot added this to the 2024-telecon milestone May 22, 2024
@FabioFracassi
Copy link
Collaborator

FabioFracassi commented Jul 23, 2024

2024-07-23 Library Evolution Telecon

P2846R2: reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges

2024-07-23 Library Evolution Telecon Minutes

Champion: Corentin Jabot
Chair: Fabio Fracassi
Minute Taker: Ben Craig

Summary

Papers Forwarding Checklist:

  1. Why should this utility go into the standard library? - Customization point for standard facilities / optimization opportunity
  2. Examples? - Yes
  3. Discussion of prior art? - Yes
  4. Implementation experience? - No
  5. Usage experience? - No
  6. Deployment experience? - No
  7. Performance considerations? - Yes, with benchmarks
  8. Changes Library Evolution previously requested? - N/A
  9. Support in "std::format" and "hash" (if required)? - N/A
  10. Feature test macro? - Yes, but needs correction
  11. Freestanding? - N/A
  12. Constexpr? - Yes
  13. Wording? - Partial, not checked

POLL: Require the use of the reserve_hint in the range constructor of vector and string in P2846R2

SF F N A SA
2 6 2 0 2

Attendance: 18
# of Authors: 1
Author's Position: SA
Outcome: consensus in favour

SA:

  • adds a lot of complexity without much benefit
  • requires a call, but does not say what is the user observable behaviour

Next Steps

Next revision will be seen by LEWG

@FabioFracassi FabioFracassi added needs-revision Paper needs changes before it can proceed and removed ready-for-library-evolution-meeting-review This paper needs to be discussed at a Library Evolution meeting scheduled-for-library-evolution This paper has been scheduled for one of the groups: LEWG, LEWG Incubator, or a Mailing List review labels Jul 23, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented Sep 21, 2024

P2846R3 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot removed the needs-revision Paper needs changes before it can proceed label Sep 21, 2024
@wg21bot wg21bot changed the title P2846 R2 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R3 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges Sep 21, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented Oct 17, 2024

P2846R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot changed the title P2846 R3 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges Oct 17, 2024
@JeffGarland JeffGarland added the LWG Library label Dec 4, 2024
@inbal2l
Copy link
Collaborator

inbal2l commented Dec 8, 2024

2024-11-21 Library Evolution Wroclaw Meeting

P2846R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges

2024-11-21 Library Evolution Wroclaw Meeting Minutes

Champion: Corentin Jabot
Chair: Inbal Levi / Robert Leahy
Minutes: Eddie Nolan

Summary

POLL: Remove the requirement for “is_nothrow_move_constructible_v” to be true from the second condition for avoiding allocation for a vector in the vector constructor in “P2846R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges”.

SF F N A SA
7 2 5 3 0

Attendance: 24 (IP) + 3 (R)
Author's Position: - (didn’t vote)
Outcome: Consensus in favor

POLL: Modify the FTM into “__cpp_lib_ranges_reserve_hint”, and apply the modification from the poll above (Remove the requirement for “is_nothrow_move_constructible_v” to be true from the second condition for avoiding allocation for a vector in the vector constructor) and forward the modified “P2846R5 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges” to LWG for C++26.

SF F N A SA
11 6 0 0 1

Attendance: 24 (IP) + 3 (R)
Author's Position: SF
Outcome: Consensus in favor

SA: There’s a very narrow use case for this paper and it can be done in another way and the complexity is high, anyone who’s making a generic wrapping range is going to want to pass on the size_hint, and the Rust implementation, 10% of all the times they wrap an iterator they do a size_hint thing, so it’s a tremendous cost for a very very narrow use case that could be implemented another way.

Next Steps

The paper with the following modifications:

  1. Modify FTM into: “__cpp_lib_ranges_reserve_hint”
  2. Remove the requirement for “is_nothrow_move_constructible_v” to be true from the second condition for avoiding allocation for a vector in the vector
  3. Fix minor wording bug - add “or”

The updated revision forwarded to LWG for C++26.

@inbal2l inbal2l added lwg-pending LWG Chair needs to disposition and removed LEWG Library Evolution labels Dec 8, 2024
@wg21bot
Copy link
Collaborator Author

wg21bot commented Dec 18, 2024

P2846R5 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot modified the milestones: 2024-telecon, 2025-telecon Dec 18, 2024
@wg21bot wg21bot changed the title P2846 R4 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R5 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges Dec 18, 2024
@JeffGarland JeffGarland removed the lwg-pending LWG Chair needs to disposition label Jan 7, 2025
@bstamour
Copy link
Collaborator

LWG looked at this paper on Monday afternoon in Hageneberg.

@bstamour
Copy link
Collaborator

LWG polled this in Hagenberg Thursday afternoon:

Put P2846R6 into C++26 with JG and RA to check edits
| F | A | N |
| 9 | 0 | 0 |

@bstamour bstamour moved this from In Progress to Tentatively Ready in 2025 Hagenberg LWG Schedule Feb 13, 2025
@cor3ntin cor3ntin added the plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. label Feb 15, 2025
@wg21bot
Copy link
Collaborator Author

wg21bot commented Mar 19, 2025

P2846R6 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges (Corentin Jabot)

@wg21bot wg21bot changed the title P2846 R5 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges P2846 R6 reserve_hint: Eagerly reserving memory for not-quite-sized lazy ranges Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B2 - improvement Bucket 2 as described by P0592: bug fixes, performance improvements, integration fixes for/between e C++26 Targeted at C++26 IS Ship vehicle: IS LWG Library plenary-approved Papers approved for inclusion in their target vehicle by plenary vote. ranges std::ranges size - medium paper size estimate
Projects
Status: No status
Status: Tentatively Ready
Development

No branches or pull requests

8 participants