Skip to content

Comments

refactor: optimize vector initialization with size hints#3191

Merged
rakita merged 1 commit intobluealloy:mainfrom
jackwener:pre_alloc
Nov 26, 2025
Merged

refactor: optimize vector initialization with size hints#3191
rakita merged 1 commit intobluealloy:mainfrom
jackwener:pre_alloc

Conversation

@jackwener
Copy link
Contributor

This pull request optimizes memory allocation for several functions by pre-allocating vectors with an estimated capacity based on iterator size hints. This change can improve performance by reducing the number of reallocations needed when populating vectors.

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

This is good, waiting for CI

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 26, 2025

CodSpeed Performance Report

Merging #3191 will not alter performance

Comparing jackwener:pre_alloc (2b60b4e) with main (111f6d3)

Summary

✅ 173 untouched

@rakita rakita merged commit d4e56ec into bluealloy:main Nov 26, 2025
31 checks passed
@jackwener jackwener deleted the pre_alloc branch November 26, 2025 10:40
@github-actions github-actions bot mentioned this pull request Nov 24, 2025
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