google / google/perfetto

Let users set the displayed time range

Open
#766 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
6.5k
Forks
868
Avg merge
2d 1h
Merged PRs (30d)
218

Description

I use perfetto to iterate on improving C++ compile times for individual files. It would be really satisfying to be able to see the "jump" once I finally break through and score a significant speedup. But perfetto automatically scales the data so that it consumes the full width of the UI. This means that when I switch to the new-and-improved time trace, it doesn't look shorter; it just looks "different".

I searched previous issues for "range", and found #737. I don't really understand javascript, but after some hacking, I was able to come up with this snippet, which I could input into the javascript console (`F12`), and set the range to 50 seconds:

```javascript
window.postMessage({perfetto: {timeStart: 0n, timeEnd: 50000000000n,},}, "https://ui.perfetto.dev")
```

The problem is that perfetto appears to restrict the display so that the data never consumes less than the full width. In particular, if I open a time trace that took less than 50 seconds overall and apply that command, it simply scales to the full width. For manual zooming, with `w` and `s`, this makes a lot of sense and is really convenient: it makes it super easy to just zoom out and see all of the data, without "overzooming". But if the user is inputting precise values, I don't think that restriction should apply.

(It'd also be nice if that inputting of precise values could get some first class UI support, but if we could just remove the zoom limit for this use case, then I could live with the javascript console!)

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the window.postMessage call with perfetto.timeStart and timeEnd is handled in the Perfetto UI, then examine the zoom behavior that prevents a range wider than the trace from showing. The work is done when precise user-supplied start and end values preserve the requested displayed range without changing the existing manual w/s zoom behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
frontend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.