Explore potential for optimization in array::insert(Iter, InputIt, InputIt)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- performance
调研方向
从 array::insert(Iter, InputIt, InputIt) 开始,跟踪其缓冲区增长和异常保证路径。评估所提议的末尾填充、临时缓冲区、重定位和旋转情况;完成的标准是在现有容量足够时避免哪怕是临时分配,同时保持强保证。
由索引模型根据 Issue 内容生成。
描述
The idea is this:
- Fill the buffer up to capacity at the end (needs a
revert_insertprotection). - Create a temporary buffer with the remaining elements (can throw).
- If temporary buffer is not empty
- Allocate new buffer with necessary size (can throw).
- Relocate elements
- first original elements, up to insertion point,
- then new elements (at the end of the original buffer),
- then new elements from the temporary buffer,
- then remaining old elements.
- If the temporary buffer is empty, rotate elements in the original buffer instead.
In the end result:
- If the original capacity could accommodate the input range, then no new buffer (even a temporary one) is allocated. This is particularly useful when the caller uses input iterators, but does know the input range size, and thus can call
reserve. - We should be able to keep the strong guarantee.
- 主要语言
- C++
- 星标
- 481
- 派生
- 111
- 平均合并
- 11 天 23 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/json 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
Linker Error with Clang on Windows linking against Boost built with MSVC可能已有人在做 @grisumbras 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
Exact double -2^63 is rejected by conversion to std::int64_t可能已有人在做 @Tyagiquamar 于 11 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
相似的 Issue
-
category:port-update
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
facebookresearch/faiss#5775 · 1 条评论 ·
维护者通常 2 天内回复
-
Eval bug: minimax-m3: build_moe_ffn() drops the per-expert NVFP4 scale → garbled output (M3.1 Flash)未关闭bug-unconfirmed
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 68/100
secondlife/viewer#6507 ·
维护者通常 1 天内回复
-
clang:frontend code-cleanup HLSL
难度 2/5 1-3 小时 新手友好度 74/100
llvm/llvm-project#235100 · 1 条评论 ·
维护者通常 1 天内回复