boostorg / boostorg/hana

Consider optimizing folds by not using variadic expansion

Open
#268 8 comments 0 reactions 0 assignees View on GitHub
optimization
Dominant language
C++
Stars
1.9k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Right now, the folds are implemented by unpacking the sequences and then folding recursively on variadic packs (with some unrolling). However, passing many parameters around can be difficult to optimize away, and overload resolution is expensive in terms of compile-time. Instead, we should consider having a unrolled recursive fold that indexes into the original structure.

Contributor guide

Open the contributing guide

Research direction

Start by locating the fold implementations and tracing how sequences are unpacked into variadic packs and recursively folded. Compare that path with the original structure and identify the existing unrolling and overload-resolution behavior; done means a validated optimization that preserves fold behavior while reducing unnecessary parameter passing and compile-time cost.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.