Stats panel: one GDI font per face per thread instead of one per text call #606
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!606
Loading…
Reference in a new issue
No description provided.
Delete branch "HQasper/Darner:pr/panel-fonts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
Picture::with_face(crates/darner-gpu/src/host/font.rs) makes, picks and deletes a GDI font for every text it measures or draws. Each call pays a new font realization: about 80 us for a measured text, against about 4 us with a font that is kept. The panel's picture is made twice a second on the submitting thread, and withDARNER_PANEL=1it took 8-9 ms at once: a frame-time spike every 500 ms.A thread now keeps the fonts it made, by face (name, height, bold), at most 32 of them; past that a call makes its own font and deletes it after, as before. The fonts are made the way main makes them now: the face the host has (
host_face), and a stand-in for Consolas drawn as wide as Consolas (stand_in_width). A kept font is deleted when its thread ends.How it was tested
Tested revision: 7fd3479 (the same tree as
21c6849; only the commit message changed after the runs).Commands and results:
cargo test -p darner-gpu --libincludes the new testa_face_s_font_is_made_once_a_thread, which passes.Changes a default: no. The panel's fonts are made as on main; they are only kept instead of made again.
A/B result: the prison cell bench, 60-210 s after the world's first frame, the panel on (
DARNER_PANEL=1), withDARNER_RANGE_LOCK=1,DARNER_ALIAS_SHARE=1,DARNER_VIEW_THREADS=8andDARNER_SUBMIT_CORE_ALONE=1in both. A is main atc8258f9, B is this branch. Two runs each, interleaved with a third build in one series (A, B, other, A, B, other). The first run of each build came right after its shader preload.The longest gaps of all runs fall where the world streams in, about 60-70 s after its first frame, with and without the change.
Gates run on 7fd3479:
cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.cargo test --workspace --locked: the first run failed 4 darner-gpu library tests. They werehost::refresh_tests::refresh_front_zero_arc_matches_and_runs_dueand threehost::watch_pipe::tests, while other builds loaded the PC. All four pass alone, and a second full run with--no-fail-fastpassed: 3,521 passed, 0 failed. On mainc8258f9under the same load,cargo test -p darner-gpu --libfailed 1-2 tests in each of 3 runs (host::card_steps::tests::shared_scratch_eliminates_flight_settle_end_to_end,watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs). This change does not touch those tests' code.Gameplay: RTX 5090, Series X profile, 1440p, DLSS Quality, frame generation off, hardware ray tracing.
Shader wave sizes tested: not relevant (no shader change).
Hardware dependence: likely general on Windows (GDI). Not tested under Wine/Proton; the fonts are made by main's own face lookup, which is what #353 added for Wine.
Coverage gaps: one PC; two runs per build; not tested under Wine/Proton.
Checklist
main.docs/asset-policy.md.Checked for overlap
font.rstoo, for other reasons: #302 (launcher window), #154 (F1 menu new look).[pr-performance] Stats panel: one GDI font per face per thread instead of one per text callto Stats panel: one GDI font per face per thread instead of one per text callTest needed — commit
21c6849e; what to check:Picture::with_face(crates/darner-gpu/src/host/font.rs) makes, picks and deletes a GDI font for every text it measures or draws. Each call pays a new font realization: about 80 us for a measured text, against about 4 us with a font that is kept. The panel's picture is made twice a second on the submitting thread, and withDARNER_PANEL=1it took 8-9 ms at once: a frame-time spike every 500 ms.A thread now keeps the fonts it made, by face (name, height, bold), at most 32 of them; past that a call makes its own font and deletes it after, as before. The fonts are made the way main makes them now: the face the host has (
host_face), and a stand-in for Consolas drawn as wide as Consolas (stand_in_width). A kept font is deleted when its thread ends.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.