本文へ移動
cccskills
無料GitHub で公開日本語紹介

fory-performance-optimization

Apache Foryの複数言語実装をプロファイルとベンチマークで分析し、シリアライズやデシリアライズの性能低下を特定して改善するスキルです。

原文原文の説明を見る

Run profile-driven bottleneck optimization across Apache Fory implementations (Java, C++, Python/Cython, Go, Rust, Swift, C#, JavaScript/TypeScript, Dart, Kotlin, Scala). Use when improving serialize/deserialize throughput or latency, recovering regressions against a reference commit, diagnosing flamegraphs, fixing perf-related CI failures, or porting proven optimizations across languages without protocol or API regressions.

apache/foryスター 4,576(GitHub 4,576 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • シリアライズの遅さを調べて改善したいとき
  • 参照版からの性能低下を特定したいとき
  • フレームグラフや性能CIの失敗を調べたいとき
  • 効果のある最適化を別言語へ移したいとき

日本語での紹介

できること

Apache Foryの各言語実装を対象に、シリアライズやデシリアライズの処理速度・遅延を測り、プロファイルからボトルネックを特定します。仮説を一つずつ検証し、変更の影響があるベンチマークを同じ環境で順番に比較します。効果が確認できた変更だけを残し、必要に応じて別言語の実装にも最適化を移します。プロトコル、言語間の互換性、APIや正しさを保ちながら、性能低下やCIの性能失敗にも対処します。

こんなときに便利

処理速度を改善したいとき、参照コミットからの性能回帰を調べたいとき、フレームグラフの読み取りや性能関連CIの失敗原因を確認したいときに向いています。複数言語で同じ処理を保守している開発にも使えます。

使い方の例

  • 「シリアライズの性能低下をプロファイルで調べ、原因を一つずつ改善してください」
  • 「この参照コミットと比較して、デシリアライズの回帰箇所を特定してください」
  • 「Rustで効果が確認できた最適化を、互換性を保ってJavaにも適用してください」

注意点

対象はApache ForyのJava、C++、Python/Cython、Go、Rust、Swift、C#、JavaScript/TypeScript、Dart、Kotlin、Scala実装です。性能比較では同一ホスト上でベンチマークを並行実行しません。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(6)

  • SKILL.md8.5 KB
  • agents/openai.yaml1.0 KB
  • references/bottleneck-playbook.md3.7 KB
  • references/language-command-matrix.md3.1 KB
  • references/round-template.md1.4 KB
  • references/workflow-checklist.md3.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Fory Performance Optimization

Mission

Deliver measurable performance improvements in Apache Fory without protocol drift, correctness regressions, benchmark-shape tricks, or accidental API rollback.

Operating Principles

  • Start from data, not intuition.
  • Profile before changing hot code.
  • Change one bottleneck at a time.
  • Benchmark sequentially on the same machine state (one benchmark process at a time).
  • Compare old/new benchmark results case-by-case in adjacent pairs: run one case on apache/main, then immediately run that same case on the current branch before moving to the next case.
  • Under high or variable host load, run multiple short adjacent baseline/current pairs. Keep each process short and alternate sides instead of lengthening one run or batching all baseline runs.
  • Keep only measured wins or explicitly requested architecture cleanups.
  • Revert speculative changes that do not pay off.
  • During each optimization round, benchmark only cases directly affected by the change. Defer unrelated controls, full-suite sanity benchmarks, and full comparison matrices to final verification of the whole optimization task unless the user explicitly requests them earlier.
  • Align with reference runtimes (usually C++ first, then Rust/Java) when behavior and ownership models differ.

Enforce Hard Constraints

  • Preserve wire protocol unless explicitly requested.
  • Preserve cross-language semantics and xlang compatibility.
  • Never run two benchmarks at the same time on one host; run exactly one benchmark command at a time.
  • Do not optimize by changing benchmark payload definitions, field encodings, or benchmark methodology.
  • Do not add payload-identity or repeated-input caches that depend on benchmark shape.
  • Do not restore removed APIs/legacy wrappers when the user forbids it.
  • Do not preserve legacy/dead code or stale docs in optimization rounds; remove them when touched.
  • Keep API surface minimal: do not add new API unless required by protocol/correctness or explicitly requested.
  • Never add public hacky API for performance shortcuts; keep optimization helpers internal/private and conceptually clean.
  • Do not hide regressions behind unsafe compiler flags or benchmark-only code paths.
  • Keep optimization surfaces nested-safe; avoid root-only shortcuts unless they are architecturally valid and requested.
  • Do not add reader-side validation solely to produce an earlier or more precise malformed-input error. A necessary crash, panic, undefined-behavior, out-of-bounds, resource-amplification, no-progress, state-pollution, type, or policy guard must keep its hot success path to a primitive branch and move exception allocation and message formatting into a cold no-inline helper when supported. If an existing bounds-safe downstream operation already raises a controlled root error, do not duplicate its validation on the hot path.

Execute Workflow

  1. Read context and constraints.
  • Read tasks/perf_optimization_rounds.md and tasks/lessons.md.
  • Read the relevant spec in docs/specification/ for any path that may affect wire behavior.
  • Record explicit user constraints (forbidden APIs, naming, architecture, protocol rules).
  1. Define target and baseline.
  • Identify one primary KPI (for example Struct Serialize ns/op or ops/sec).
  • Benchmark current HEAD.
  • If a reference commit is provided, persist its built benchmark artifact and commit identity. Treat stored numbers as historical context, not a substitute for an adjacent baseline run in each comparison pair.
  1. Profile the hotspot.
  • Capture a flamegraph or sampled stacks on the exact benchmark command.
  • Quantify top costs by bucket (runtime bookkeeping, dispatch, allocation/copy, map/cache operations, buffer growth, metadata parse/validation).
  • Tie each bucket to concrete file/line ownership before proposing changes.
  1. Form one round hypothesis.
  • State one bottleneck and one expected effect.
  • Prefer structural fixes over micro-tweaks.
  • If another runtime already solved the same bottleneck, port its design shape first.
  1. Implement minimal change.
  • Touch the smallest surface that can validate the hypothesis.
  • Keep invariants explicit: protocol bytes, ownership, cache lifetime, reference semantics, nullability, schema-compatible behavior.
  1. Verify correctness.
  • Run language-local build/test/lint for the touched implementation.
  • Run cross-language checks when runtime/type/protocol behavior can affect xlang.
  • Confirm serialized sizes and compatibility expectations where applicable.
  • For Java performance work, defer local GraalVM image builds and executions to the final verification of the whole optimization task. Do not repeat them in individual rounds unless the user explicitly requests an earlier run.
  1. Benchmark and compare.
  • Run targeted benchmark at least twice sequentially.
  • Pair each baseline case with the matching current-branch case before starting another case, so both measurements see closer machine load conditions.
  • When host load is high or pair results conflict, use several short baseline/current pairs with the same warmup and measurement settings. Run baseline, current, baseline, current as separate processes; never run all baseline samples before all current samples.
  • Record every pair while it runs. Exclude a pair only with objective contamination evidence such as a competing process, load spike, interruption, or throughput collapse; record the exclusion and do not cherry-pick by direction.
  • Compare paired deltas using their median and dispersion. Do not optimize from a single pair, non-adjacent samples, or a contaminated result. If the retained pairs do not establish a stable signal, stop and wait for a cleaner window instead of changing code against the apparent result.
  • At final verification of the whole optimization task, run the deferred full-suite sanity benchmark and matched comparison matrix to check collateral regressions. Do not repeat these benchmarks in individual optimization rounds.
  1. Decide keep or revert.
  • Keep only if gain is repeatable or cleanup is explicitly requested and accepted with measured tradeoff.
  • Revert if performance regresses or gain is within noise and complexity increases.
  • If a required cleanup regresses, redesign inside the new architecture instead of restoring banned patterns.
  1. Log every round.
  • Append one round entry to tasks/perf_optimization_rounds.md before starting the next round.
  • Include hypothesis, code change, exact commands, before/after numbers, and keep/revert decision.
  • Commit retained non-trivial rounds immediately.
  1. Re-plan on instability.
  • Stop and re-plan when benchmark runs conflict, machine contention is suspected, or profile does not match hypothesis.
  • On a busy machine, re-plan the measurement schedule to multiple short adjacent pairs before forming an optimization hypothesis from benchmark deltas.
  • Re-ground on current HEAD after reset/rebase/checkout events before making further changes.

Apply Decision Rules

  • Treat <1-2% movement as noise unless repeated under controlled runs.
  • Require explicit proof for complexity-increasing optimizations.
  • Prefer deleting dead APIs and dead state quickly after refactors.
  • Keep naming/API cleanup only if performance remains in band.
  • Never run before/after comparisons in parallel.

Use References

Produce Output

When finishing an optimization task, report:

  • Baseline command and numbers.
  • Final command and numbers.
  • Net delta on primary KPI.
  • Correctness and compatibility verification run.
  • Kept vs reverted rounds and rationale.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

fory-release

無料概要あり

Apache Foryのリリース候補を準備し、バージョン更新、RCタグ作成、JVM成果物の公開、ソース配布、投票メールの下書きまで進めるスキルです。

  • Foryのリリース候補を作成したいとき
  • 中断したRC作業を再開したいとき
  • 成果物を確認して投票メールを用意したいとき
apache/fory4,5762026年10月27日 更新

fory-version-bump

無料概要あり

Apache Foryの各言語や文書にあるバージョン表記を、リリース版と次期開発版に分けて一括更新し、ずれや更新漏れを確認するスキルです。

  • リリース用のバージョンにそろえたいとき
  • 次の開発版へ一括で切り替えたいとき
  • インストール文書を公開版に更新したいとき
apache/fory4,5762026年10月27日 更新

apache のスキルをすべて見る

このスキルの問題を報告する