Skip to content

optimized range insertion for boost::container::hub - #339

Merged
igaztanaga merged 1 commit into
boostorg:developfrom
joaquintides:feature/optimized-range-insertion
Aug 5, 2026
Merged

optimized range insertion for boost::container::hub#339
igaztanaga merged 1 commit into
boostorg:developfrom
joaquintides:feature/optimized-range-insertion

Conversation

@joaquintides

Copy link
Copy Markdown
Member

Optimizes range insertion taking advantage of the fact that insertion goes through all non-empty and non-full blocks first and then uses empty blocks exclusively. Current hub tests cover all the new code, including catch blocks.

Performance increase (perf.cpp, release mode):

GCC 13

Before

n       t(regular insert) / t(range insert)
10E2    1.1193
10E3    1.14559
10E4    1.14469
10E5    1.18275
10E6    1.16951

After

n       t(regular insert) / t(range insert)
10E2    1.67431
10E3    1.38766
10E4    1.42388
10E5    1.71183
10E6    1.7539

Clang 13 for Visual Studio (clang-cl)

Before

n       t(regular insert) / t(range insert)
10E2    1.16093
10E3    1.27721
10E4    1.1313
10E5    1.18809
10E6    1.2059

After

n       t(regular insert) / t(range insert)
10E2    1.65984
10E3    1.916
10E4    1.4827
10E5    1.6352
10E6    1.70056

VS 2022

Before

n       t(regular insert) / t(range insert)
10E2    1.25101
10E3    1.26594
10E4    1.16627
10E5    1.09216
10E6    1.21067

After

n       t(regular insert) / t(range insert)
10E2    1.41975
10E3    1.44301
10E4    1.30676
10E5    1.32164
10E6    1.38581

@joaquintides joaquintides changed the title optimized range insertion optimized range insertion for boost::container::hub Aug 3, 2026
@igaztanaga
igaztanaga merged commit 6a1d38b into boostorg:develop Aug 5, 2026
61 checks passed
igaztanaga added a commit that referenced this pull request Aug 6, 2026
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