Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve command line --print-fps display #47735

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Apr 8, 2021

Follow-up to #47733.

  • Display the frame time in addition to FPS.
    • Frame time is a more objective measurement in comparison to FPS, but FPS is more familiar to people less acquainted with profiling.
  • Rename "Game" to "Project" for the project FPS printing line.

I've also experimented with printing the project FPS with leading indentation to distinguish it from editor FPS when the output is intertwined, but I decided not to include it in this PR. (We can't print both on the same line because they're printed from separate processes at a separate time.)
Here's what it looked like (disregard the incorrect mspf rounding, which I fixed in this PR):

Editor FPS: 22 (45.0 mspf)
                                Project FPS: 143 (6.0 mspf)
Editor FPS: 22 (45.0 mspf)
                                Project FPS: 144 (6.0 mspf)
Editor FPS: 20 (50.0 mspf)
                                Project FPS: 144 (6.0 mspf)
Editor FPS: 25 (40.0 mspf)

@Calinou Calinou requested a review from a team as a code owner April 8, 2021 21:05
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:core labels Apr 8, 2021
@Calinou Calinou added this to the 4.0 milestone Apr 8, 2021
main/main.cpp Outdated Show resolved Hide resolved
- Display the frame time in addition to FPS.
  - Frame time is a more objective measurement in comparison to FPS,
    but FPS is more familiar to people less acquainted with profiling.
- Rename "Game" to "Project" for the project FPS printing line.
@Calinou Calinou force-pushed the improve-cli-print-fps-display branch from 871ec59 to 157d8e4 Compare April 9, 2021 12:59
@akien-mga akien-mga merged commit ba1adc3 into godotengine:master Apr 9, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.3.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Apr 11, 2021
Comment on lines +2540 to +2543
print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
}
} else if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) {
print_line("Game FPS: " + itos(frames));
print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(1)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote this on Twitter, but I'll post here too: I suggest s/mspf/ms

@Calinou Calinou deleted the improve-cli-print-fps-display branch August 3, 2021 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants