Files: the title's packs are opened with FILE_FLAG_NO_BUFFERING, so every launch reads them from the drive (RTX 2070 SUPER: 34-37 s -> 21-23 s to the title screen with the file cache) #422

Open
opened 2026-11-27 02:26:33 +00:00 by Jesper-Andersson · 0 comments
Jesper-Andersson commented 2026-11-27 02:26:33 +00:00 (Migrated from github.com)
Contributor

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Jesper-Andersson on 2026-11-27T02:26:33Z.


The title opens its packs read-only with FILE_FLAG_NO_BUFFERING, and files::CreateFileW passes the flag on to the host. On Windows that keeps every read of those files out of the system file cache, so each launch reads the same bytes from the drive again, however recently the game ran. On this PC, letting those opens go through the file cache cut launch to the title-screen logo from 34-37 s to 21-23 s.

Machine

  • GPU: NVIDIA GeForce RTX 2070 SUPER 8 GB, driver 32.0.16.2114 (621.14)
  • CPU / RAM / OS: Ryzen 7 5800X / 32 GB / Windows 11 Pro 10.0.26320
  • Game, repo and cache on a SATA SSD (Samsung 870 QVO)
  • Local branch test-perf @ 64c3742 + the change (numbers from a local branch, not from main), diag build

Where

crates/victory-hle/src/modules/files.rs:263-282 at 014d52d: CreateFileW (and CreateFileA) hand the title's flags to the host's CreateFileW unchanged.

A one-line log of each unbuffered open showed the title opening 8 files this way right at launch, all access=0x80000000 (GENERIC_READ), flags=0x20000000 (FILE_FLAG_NO_BUFFERING), none overlapped. Its DirectStorage reads are not affected: our dstorage.rs opens its own handles, which already go through the cache (VICTORY_DSTORAGE_IO=handles).

What was run

scripts\play.ps1 -Exe <game exe> -NoWarm -More @{VICTORY_FILE_CACHE='0'}   # A1, A2
scripts\play.ps1 -Exe <game exe> -NoWarm -More @{VICTORY_FILE_CACHE='1'}   # B1, B2

Series S, DLSS, intro movies skipped (local branch), launched one after another, each closed at the title screen. Timed from the first log line to the start of the 2560x1440 logo movie, which comes before the title waits for a key.

Results

Run file cache to the logo of which: first movie -> logo
A1 off (as now) 36.8 s 27.9 s
A2 off (as now) 34.3 s 25.3 s
B1 on 22.8 s 14.7 s
B2 on 21.1 s 15.5 s

Each run logged the same 8 refused compute pipelines this card always has (see #70), and nothing new. B1 was already fast, on its first launch with the cache on, so the gain is not only from the cache being warm on later launches.

Notes

  • The same change is part of Marvisak/VIctory#2427 by imjustprism (commit 79fd6c2, rebased as Marvisak/VIctory#2667). That PR bundles it with three other parts; its triage asked for the file-cache part to be split out and timed on its own, which had no timing yet. These runs are that timing, on another machine.
  • Not checked: a hard drive, a cold launch after a reboot, AMD, Linux/Proton.

AI use

AI-assisted (Claude Code): the change, the runs' setup and this write-up. The runs were played on the machine above.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6638680924 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/issues/422). Originally posted by [Jesper-Andersson](https://github.com/Jesper-Andersson) on 2026-11-27T02:26:33Z. --- The title opens its packs read-only with `FILE_FLAG_NO_BUFFERING`, and `files::CreateFileW` passes the flag on to the host. On Windows that keeps every read of those files out of the system file cache, so each launch reads the same bytes from the drive again, however recently the game ran. On this PC, letting those opens go through the file cache cut launch to the title-screen logo from 34-37 s to 21-23 s. ## Machine - GPU: NVIDIA GeForce RTX 2070 SUPER 8 GB, driver 32.0.16.2114 (621.14) - CPU / RAM / OS: Ryzen 7 5800X / 32 GB / Windows 11 Pro 10.0.26320 - Game, repo and cache on a SATA SSD (Samsung 870 QVO) - Local branch `test-perf` @ 64c3742 + the change (numbers from a local branch, not from `main`), diag build ## Where `crates/victory-hle/src/modules/files.rs:263-282` at `014d52d`: `CreateFileW` (and `CreateFileA`) hand the title's `flags` to the host's `CreateFileW` unchanged. A one-line log of each unbuffered open showed the title opening 8 files this way right at launch, all `access=0x80000000` (`GENERIC_READ`), `flags=0x20000000` (`FILE_FLAG_NO_BUFFERING`), none overlapped. Its DirectStorage reads are not affected: our `dstorage.rs` opens its own handles, which already go through the cache (`VICTORY_DSTORAGE_IO=handles`). ## What was run ``` scripts\play.ps1 -Exe <game exe> -NoWarm -More @{VICTORY_FILE_CACHE='0'} # A1, A2 scripts\play.ps1 -Exe <game exe> -NoWarm -More @{VICTORY_FILE_CACHE='1'} # B1, B2 ``` Series S, DLSS, intro movies skipped (local branch), launched one after another, each closed at the title screen. Timed from the first log line to the start of the 2560x1440 logo movie, which comes before the title waits for a key. ## Results | Run | file cache | to the logo | of which: first movie -> logo | |---|---|---|---| | A1 | off (as now) | 36.8 s | 27.9 s | | A2 | off (as now) | 34.3 s | 25.3 s | | B1 | on | 22.8 s | 14.7 s | | B2 | on | 21.1 s | 15.5 s | Each run logged the same 8 refused compute pipelines this card always has (see #70), and nothing new. B1 was already fast, on its first launch with the cache on, so the gain is not only from the cache being warm on later launches. ## Notes - The same change is part of Marvisak/VIctory#2427 by imjustprism (commit 79fd6c2, rebased as Marvisak/VIctory#2667). That PR bundles it with three other parts; its triage asked for the file-cache part to be split out and timed on its own, which had no timing yet. These runs are that timing, on another machine. - Not checked: a hard drive, a cold launch after a reboot, AMD, Linux/Proton. ## AI use AI-assisted (Claude Code): the change, the runs' setup and this write-up. The runs were played on the machine above.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX#422
No description provided.