Skip to content

Commit 28cf600

Browse files
timfoxcursoragent
andauthored
feat(fs): fs_startupTiming for FS_Startup wall time; PR hygiene docs (#10)
* feat(fs): add fs_startupTiming for measurable FS_Startup cost - New temp cvar fs_startupTiming (default 0): when set, log wall ms for FS_Startup after path/pk3 setup. - README: PR hygiene note + how to measure FS startup; CONTRIBUTING: PR queue expectations. No compiler flag changes. Co-authored-by: Tim Fox <timfox@outlook.com> * style: uncrustify FS_Startup cvar block Co-authored-by: Tim Fox <timfox@outlook.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent f2b70cd commit 28cf600

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ If you are interested to participate, ensure to read first our contribution guid
4242
* [How to commit your code](https://github.com/etlegacy/etlegacy/wiki/How-to-commit-Your-Code)
4343
* [Coding conventions](https://github.com/etlegacy/etlegacy/wiki/Coding-Conventions)
4444

45+
## PULL REQUESTS
46+
47+
Rebase onto **current `main`** before review, and avoid PRs that would **revert** unrelated landed changes. Close obsolete PRs that are superseded or remain **unmergeable** after a rebase.
48+
4549
## UPSTREAM AND FORKS
4650

4751
To pull the latest changes from the main ET: Legacy repository without merging yet:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ GitHub Actions on **`main`** / **`master`** run **[`.github/workflows/ci.yml`](.
106106

107107
Forks without **`LEGACY_CI_WEBHOOK`** still get a full CI signal; the optional Discord notify step is skipped when that secret is unset. The **`check-compiler-warnings`** job scans native build logs for new compiler warnings in game code; **Android** and **Windows** (`win` / `win64`) logs are treated as informational only (see `misc/collect-and-check-gh-build-logs.py`).
108108

109+
**Pull request hygiene:** Before merging, confirm the branch is **rebased on current `main`** and does not revert unrelated work. Close or update stale PRs that show **merge conflicts** against `main`.
110+
111+
**Measuring filesystem startup:** Use **`+set fs_startupTiming 1`** on the command line (or set `fs_startupTiming` to `1` in the console before a full FS re-init). The log prints **`FS startup wall time: N ms`** after pk3 search paths are built. For per-frame timing once running, use **`com_speeds`**.
112+
109113
## Development helpers
110114

111115
[Pixi](https://pixi.sh/) workspace: **`pixi.toml`**.

src/qcommon/files.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ typedef struct searchpath_s
256256
*/
257257
char fs_gamedir[MAX_OSPATH];
258258
static cvar_t *fs_debug;
259+
static cvar_t *fs_startupTiming;
259260
static cvar_t *fs_homepath;
260261
static cvar_t *fs_basepath;
261262
static cvar_t *fs_basegame;
@@ -4502,14 +4503,17 @@ static void FS_Startup(const char *gameName)
45024503
{
45034504
const char *homePath;
45044505
int i;
4506+
int fs_startup_begin_ms;
45054507

45064508
Com_Printf("----- Initializing Filesystem --\n");
45074509

45084510
fs_packFiles = 0;
45094511

4510-
fs_debug = Cvar_Get("fs_debug", "0", 0);
4511-
fs_basepath = Cvar_Get("fs_basepath", Sys_DefaultInstallPath(), CVAR_INIT | CVAR_PROTECTED);
4512-
fs_basegame = Cvar_Get("fs_basegame", "", CVAR_INIT | CVAR_PROTECTED);
4512+
fs_debug = Cvar_Get("fs_debug", "0", 0);
4513+
fs_startupTiming = Cvar_Get("fs_startupTiming", "0", CVAR_TEMP);
4514+
fs_startup_begin_ms = Sys_Milliseconds();
4515+
fs_basepath = Cvar_Get("fs_basepath", Sys_DefaultInstallPath(), CVAR_INIT | CVAR_PROTECTED);
4516+
fs_basegame = Cvar_Get("fs_basegame", "", CVAR_INIT | CVAR_PROTECTED);
45134517

45144518
homePath = Sys_DefaultHomePath();
45154519

@@ -4615,6 +4619,11 @@ static void FS_Startup(const char *gameName)
46154619

46164620
#endif // ifndef DEDICATED
46174621

4622+
if (fs_startupTiming->integer)
4623+
{
4624+
Com_Printf("FS startup wall time: %i ms\n", Sys_Milliseconds() - fs_startup_begin_ms);
4625+
}
4626+
46184627
Com_Printf("--------------------------------\n");
46194628
}
46204629

0 commit comments

Comments
 (0)