prometheus / prometheus/client_java
Extra allocations in `*TextFormatWriter` because of Java 8 target
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 2.3k
- フォーク
- 833
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 86
説明
See this line of code:
Because of the Java 8 target, the string concatenation gets compiled to something like new StringBuilder().append(name).append(suffix).toString(), which allocates the memory at least twice (for the buffer in the StringBuilder and for the resulting string).
If the code was compiled for at least Java 9, it would use StringConcatFactory, which in this case would allocate the memory only for the resulting string.
Would the maintainers consider publishing multiple artifacts for different Java targets, or using multi-release JARs for the purpose of this and similar optimizations?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンク先の行にある OpenMetricsTextFormatWriter.java から始め、プロジェクトが Java 8 をどのようにターゲットとしているかを確認してください。次に、issue に記載されている artifact の公開と multi-release JAR の選択肢を調査してください。関連する TextFormatWriter コード全体でこれらのアロケーションを削減するための、文書化され maintainer に承認されたアプローチが得られれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- build-system, release
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100