adding a small integer to a `BigInt` with `operate!` allocates
まだ誰も着手していません。
評価
調査の方向性
まず、MutableArithmetics を使った Julia REPL の例を再現し、BigInt に対して MA.operate!(+, x, 1) で使用される dispatch を調べます。言及されている Base.GMP.MPZ.add_si! および add_ui! のエントリポイントと比較します。小さい整数を加算したときに、不要な BigInt への変換や割り当てが行われなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Presumably the small integer is being converted to BigInt by mistake. It is possible to add some small ints to a BigInt directly using Base.GMP.MPZ.add_si! (or Base.GMP.MPZ.add_ui!).
julia> using MutableArithmetics: MutableArithmetics as MA
julia> x = BigInt(0)
0
julia> @timev MA.operate!(+, x, 1)
0.086091 seconds (135.80 k allocations: 7.078 MiB, 99.88% compilation time)
elapsed time (ns): 8.6090543e7
gc time (ns): 0
bytes allocated: 7421600
pool allocs: 135768
non-pool GC allocs: 1
malloc() calls: 34
realloc() calls: 1
free() calls: 0
minor collections: 0
full collections: 0
1
julia> @timev MA.operate!(+, x, 1)
0.000022 seconds (2 allocations: 56 bytes)
elapsed time (ns): 21772.0
gc time (ns): 0
bytes allocated: 56
pool allocs: 1
non-pool GC allocs: 0
malloc() calls: 1
free() calls: 0
minor collections: 0
full collections: 0
2
- 主要言語
- TeX
- スター
- 55
- フォーク
- 15
- 平均マージ
- 17時間 21分
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jump-dev/MutableArithmetics.jl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
jump-dev/MutableArithmetics.jl#293 · コメント 8 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
jump-dev/MutableArithmetics.jl#253 · コメント 7 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
jump-dev/MutableArithmetics.jl の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melodic-software/claude-code-plugins#9619 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)オープンcause/upstream comp/cli P2 provider/other tool/file type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#143900 ·
メンテナーはふだん 1 日以内に返信
-
venn: a name that starts with set-, union-, text- or style- followed by a letter is a parse errorオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
obsidianmd/pele#65 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
keyxmakerx/Chronicle#1700 ·
メンテナーはふだん 1 日以内に返信