Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

adding a small integer to a `BigInt` with `operate!` allocates

オープン
#353 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
julia
領域
tooling

調査の方向性

まず、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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jump-dev/MutableArithmetics.jl のほかの issue

jump-dev/MutableArithmetics.jl の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。