fix: address review feedback on profiler flamegraph/icicle - #167
Merged
Merged
Conversation
- Raise ValueError when sort_by/limit passed with flamegraph/icicle - Remove dead zoomStack code from JS (reset renders from root directly) - Unify total time source: use total_tt consistently in flame HTML - Add edge tuple format comment for CPython version differences - Clarify tooltip label: "Cumulative (path)" vs ambiguous "Cumulative" - Add empty-profile and sort_by/limit rejection tests for flamegraph
5 tasks
Contributor
There was a problem hiding this comment.
Review — PR #167: fix: address review feedback on profiler flamegraph/icicle
CI: ✅ Green (lint + 3.10–3.13)
Verdict: LGTM — clean follow-up, all feedback items addressed.
What's fixed
| #166 feedback | Resolution |
|---|---|
sort_by/limit silently ignored for flamegraph/icicle |
ValueError raised when either is passed with non-table style |
zoomStack dead code |
Removed entirely — click-to-zoom re-renders directly, reset re-renders from root |
total_tt vs self.total_time dual access |
_build_flame_html now reads stats.total_tt directly, matching _extract_call_tree |
| Edge tuple format undocumented | Comment added: # edge is (cc,nc,tt,ct) or (nc,ct) depending on CPython version |
| No empty-profile test | test_flamegraph_empty_profile added |
| Tooltip ambiguity on cumtime meaning | Label changed to "Cumulative (path):" |
Three new tests cover the empty-profile path and both ValueError cases. +26/−6 across 2 files — focused and minimal. Nothing to flag.
Contributor
There was a problem hiding this comment.
CI green across lint + 3.10–3.13. Clean, focused follow-up that addresses all actionable feedback from #166 — nothing missed.
sort_by/limitnow raiseValueErrorfor flamegraph/icicle — guard is placed before_extract_call_tree(), so no wasted work. Tests cover both params independently.zoomStackremoved — all three references gone (declaration, push inonFrameClick, clear in reset).onFrameClicksimplified to justrender([node], node.cumtime). Clean.total_ttunified —_build_flame_htmlnow usescast(Any, self._stats).total_ttinstead ofself.total_time, consistent with_extract_call_tree. Fixes the CPU-vs-wall-clock divergence milo flagged.- Edge tuple comment — documents the
(cc,nc,tt,ct)vs(nc,ct)CPython version difference inline. - Tooltip label — "Cumulative (path)" clarifies the edge-specific semantics.
- Empty-profile test — good edge case addition.
+26/−6, no issues. LGTM 👍
Contributor
There was a problem hiding this comment.
All six items from #166 addressed cleanly:
sort_by/limitnow raiseValueErrorfor flamegraph/icicle — good, explicit beats silent.zoomStackremoved — deadvar, push inonFrameClick, and reset-handler clear all gone. Bonus: dropped the unusedeparameter too.total_time→total_ttin_build_flame_html— CPU time now consistent with_extract_call_tree. Comment makes the intent clear.- Edge tuple format comment added at the extraction site.
- Tooltip label → "Cumulative (path)" — disambiguates from function-global tottime.
- Three new tests — empty profile,
sort_byrejection,limitrejection. All three assert the right error message.
CI green across lint + 3.10–3.13. Nothing else to flag — straightforward follow-up.
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
Addresses all actionable and non-blocking review feedback from #166:
sort_by/limitpassed with flamegraph/icicle styles (flagged by all 3 reviewers)zoomStackcode — reset renders directly from root data (flagged by all 3 reviewers)_build_flame_htmlnow usestotal_ttconsistently with_extract_call_tree(milo)Test plan
make test-profiler— 68 tests pass (3 new)pre-commit run --all-files— all hooks pass