tests: add cProfile performance tests for plugin framework#2062
Merged
crivetimihai merged 3 commits intomainfrom Jan 14, 2026
Merged
tests: add cProfile performance tests for plugin framework#2062crivetimihai merged 3 commits intomainfrom
crivetimihai merged 3 commits intomainfrom
Conversation
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
- Add noqa E402 comments for intentional late imports after sys.path - Fix type annotation: use Any instead of any (lowercase was incorrect) - Remove unnecessary f-string prefixes from static strings Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
03bbb89 to
02cb79e
Compare
crivetimihai
approved these changes
Jan 14, 2026
kcostell06
pushed a commit
to kcostell06/mcp-context-forge
that referenced
this pull request
Feb 24, 2026
* tests: add cProfile performance tests for plugins Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com> * tests: add comparison script for plugin framework profiles Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com> * fix: address linting issues in plugin profiling tests - Add noqa E402 comments for intentional late imports after sys.path - Fix type annotation: use Any instead of any (lowercase was incorrect) - Remove unnecessary f-string prefixes from static strings Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com> Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces comprehensive performance profiling tooling for the plugin framework using Python's cProfile. The new test suite enables systematic profiling of individual plugin hooks to identify performance bottlenecks and measure optimization impact.
Closes #2061
Changes
New Files
tests/performance/test_plugins_performance.py.proffiles for detailed analysis--detailsflag for immediate detailed outputtests/performance/PLUGIN_PROFILING.mdtests/performance/plugins/config.yamltests/performance/utils/analyze_profiles.pyModified Files
tests/performance/Makefiletests/performance/README.mdFeatures
Performance Profiling
invoke_hook()calls only (plugin loading excluded).proffile per plugin-hook combinationplugins/config.yamlfor plugin configurationOutput Modes
Default (summary only):
Detailed (with per-hook profiling output):
Sample Output
Legend:
Usage
Run Performance Tests
Analyze Specific Profile
Visualize with SnakeViz
Create call graph
gprof2dot -f pstats plugins/prof/SecretsDetection_prompt_pre_fetch.prof | dot -Tsvg -o plugins/prof/SecretsDetection_prompt_pre_fetch.svgCreate flame graph
flameprof plugins/prof/PIIFilterPlugin_tool_pre_invoke.prof > plugins/prof/flamegraph.svgBenefits
Documentation
Complete documentation available in:
tests/performance/PLUGIN_PROFILING.md