Repository navigation
feat(profiler): collapse the recursion of the call graph into a node per function, with UI 1.44 - #400
Merged
Merged
Conversation
2 tasks done
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #400 +/- ##
==========================================
+ Coverage 82.40% 82.50% +0.09%
==========================================
Files 489 490 +1
Lines 20739 20838 +99
==========================================
+ Hits 17091 17192 +101
+ Misses 3648 3646 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
roxblnfk
force-pushed
the
feat/collapse-recursion
branch
from
November 26, 2026 18:07
284020f to
d941dcc
Compare
1 task done
…per function on request A node per recursion level, as XHProf names them, turns deep recursion into a ladder of one function: `recursion=collapsed` merges the levels and draws direct recursion as a call of the node to itself. A merged node and its calls count each outermost call once: the calls along the recorded call tree, exact; along the recursion levels alone for a flat XHProf profile, where a call deeper in a recursion may have come through another function. The response tells the mode, so the UI knows the server takes the option. The MCP tools sum the levels the same way, now through one helper. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The Call graph of a profile gets the «Collapse recursion» switch: a node per function, a function calling itself drawn with an edge to itself. The mock rule conditions of 1.44 need the mock server, which Trap has not. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
…se over 20 elements The call graph then shows a recursion: a ladder of 20 `bar` levels, or one node calling itself with the recursion collapsed. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
roxblnfk
force-pushed
the
feat/collapse-recursion
branch
from
November 27, 2026 12:09
ac2789d to
0742bc0
Compare
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.
🔍 What was changed
GET /api/profiler/{uuid}/call-graphtakesrecursion=collapsed: a node per function instead of a node per recursion level (foo,foo@1, … after XHProf). The response hasrecursion: levels|collapsed, so the UI knows the server takes the option; without the parameter the graph is as before.docs/profiles.mddescribes it.trap testhasbarrecursing over 20 elements, to show the recursion in the call graph.profile_callsmoved toStruct\Recursion, shared with the call graph.How it works
bar (3x, 1 recursive),foo (2 sampled calls, 1 recursive)for SPX sampling), and takes the outermost level for sampled ones, where a sample counts once.trap test: the 121-deep recursion goes from 128 nodes to 8, the Yii XHProf profile from 535 to 86.Review notes
recursionkey, on random trees and every payload, with one exception: a call graph with a literal self-call (a==>a, which XHProf never writes, as it names the inner calla@1) now keepsaas a root, so a cycle below it gets linked to it.Checklist
trap testin both modes