diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31e6ed63b..77ca0dde4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,10 @@ If you are interested to participate, ensure to read first our contribution guid * [How to commit your code](https://github.com/etlegacy/etlegacy/wiki/How-to-commit-Your-Code) * [Coding conventions](https://github.com/etlegacy/etlegacy/wiki/Coding-Conventions) +## PULL REQUESTS + +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. + ## UPSTREAM AND FORKS To pull the latest changes from the main ET: Legacy repository without merging yet: diff --git a/README.md b/README.md index 622f41c80..b8da56e2b 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,10 @@ GitHub Actions on **`main`** / **`master`** run **[`.github/workflows/ci.yml`](. 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`). +**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`. + +**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`**. + ## Development helpers [Pixi](https://pixi.sh/) workspace: **`pixi.toml`**. diff --git a/src/qcommon/files.c b/src/qcommon/files.c index d36457c92..13a6952c8 100644 --- a/src/qcommon/files.c +++ b/src/qcommon/files.c @@ -256,6 +256,7 @@ typedef struct searchpath_s */ char fs_gamedir[MAX_OSPATH]; static cvar_t *fs_debug; +static cvar_t *fs_startupTiming; static cvar_t *fs_homepath; static cvar_t *fs_basepath; static cvar_t *fs_basegame; @@ -4502,14 +4503,17 @@ static void FS_Startup(const char *gameName) { const char *homePath; int i; + int fs_startup_begin_ms; Com_Printf("----- Initializing Filesystem --\n"); fs_packFiles = 0; - fs_debug = Cvar_Get("fs_debug", "0", 0); - fs_basepath = Cvar_Get("fs_basepath", Sys_DefaultInstallPath(), CVAR_INIT | CVAR_PROTECTED); - fs_basegame = Cvar_Get("fs_basegame", "", CVAR_INIT | CVAR_PROTECTED); + fs_debug = Cvar_Get("fs_debug", "0", 0); + fs_startupTiming = Cvar_Get("fs_startupTiming", "0", CVAR_TEMP); + fs_startup_begin_ms = Sys_Milliseconds(); + fs_basepath = Cvar_Get("fs_basepath", Sys_DefaultInstallPath(), CVAR_INIT | CVAR_PROTECTED); + fs_basegame = Cvar_Get("fs_basegame", "", CVAR_INIT | CVAR_PROTECTED); homePath = Sys_DefaultHomePath(); @@ -4615,6 +4619,11 @@ static void FS_Startup(const char *gameName) #endif // ifndef DEDICATED + if (fs_startupTiming->integer) + { + Com_Printf("FS startup wall time: %i ms\n", Sys_Milliseconds() - fs_startup_begin_ms); + } + Com_Printf("--------------------------------\n"); }