getappmap / getappmap/appmap-java

Reduce allocations required to enter a hook

未关闭
#52 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
88
派生
17
平均合并
2 天 2 小时
30 天内合并 PR
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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位克隆事件模板的 hook 路径,以及写入事件的 serializer。跟踪静态属性如何从模板传递到每个克隆的事件中。完成的标准是:自定义 serializer 直接从模板写入这些属性,并避免每个 hook 的克隆分配;该 issue 没有提供具体文件或要运行的测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
performance
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。