Skip to content

Timings graph should fit the screen by default #15666

@Expurple

Description

@Expurple

Problem

When I open an HTML file with timings, it always chooses "Scale: 20". Depending on the project, the graph is always too wide or too narrow with this default setting. I always manually adjust the scale to fit the screen, and that's very annoying.

Here's how wide it is for my proprietary project (note the horizontal scrollbar at the bottom, the graph is 2x wider than the window):

Wide proprietary graph

And here's how narrow it is for SeaORM:

Narrow SeaORM graph

The graph width seems roughly proportional to the total compile time? (134 vs 14 seconds)

It's unclear what unit "Scale" is supposed to be.

Steps

  1. git clone --single-branch --depth=1 https://github.com/SeaQL/sea-orm.git
  2. cd sea-orm/
  3. cargo +nightly build --timings
  4. firefox target/cargo-timings/cargo-timing.html

Possible Solution(s)

Automatically choose the "Scale" setting that makes the graph fit the screen. At least, there should be a button that jumps to the optimal scale.

The proprietary graph with manually adjusted Scale (note the whitespace on the right. The horizontal scrollbar at the bottom is gone):

Adjusted proprietary graph

SeaORM graph with manually adjusted Scale:

Adjusted SeaORM graph

I can't even manually adjust SeaORM graph to screen width, because of the max scale limit. But that's a separate issue and there could be legitimate reasons. I'd be OK if it at least auto-expanded to this max allowed scale.

Notes

I use Firefox 136.0 on Linux. I've also checked Chromium 137.0.7151.103, the same thing happens.

Could be somehow related: #8850

Version

cargo 1.89.0-nightly (fc1518ef0 2025-06-06)
release: 1.89.0-nightly
commit-hash: fc1518ef02b77327d70d4026b95ea719dd9b8c51
commit-date: 2025-06-06
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.2 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.5.0)
ssl: OpenSSL 3.5.0 8 Apr 2025
os: Ubuntu 25.4.0 (plucky) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-timingsArea: timingsC-bugCategory: bugS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions