getappmap / getappmap/appmap-java
Reduce allocations required to enter a hook
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 88
- フォーク
- 17
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 1
説明
When a method is called, an "event template" is cloned and passed into the hook to be mutated. The template serves as cache for all the static properties (src path, defined class, method id, etc). It prevents us from needing to perform costly run-time reflection in nearly all cases.
This means we're cloning a new event from and event template for every hook called. We can drop these allocations by implementing a custom serializer that writes properties directly from the event template.
Not in scope for this issue, but worth keeping top of mind, is that we can cut Event allocations almost entirely by reusing events. We only need enough events to fill the buffer in the file stream. Once they're written, we can place them back in the pool to be picked up by another thread.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、イベントテンプレートをクローンする hook path と、イベントを書き込む serializer を見つけます。静的プロパティがテンプレートから各クローン済みイベントへどのように渡されるかを追跡します。カスタム serializer がそれらのプロパティをテンプレートから直接書き込み、hook ごとのクローン割り当てを回避できれば完了です。この issue には、特定のファイルや実行するテストは示されていません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- performance
- issue の種類
- リファクタリング
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100