Repository navigation
Conversation
console_drive compared the GAME: prefix through a lowered substring, and for G:/T: paths copied both roots out of the lock and lowered copies of the path and each root in lies_under; parse_console grew each component a character at a time and copied it into parts; and every T: path ran std::filesystem::create_directories on the scratch folder, whose status opens a handle to it. Now the prefix and roots are compared in place (roots under g_mutex), components are sliced from the path, and create_directories only runs when GetFileAttributesW does not report the folder. file_system_parse_test checks the parse against the earlier code on edge cases and 200 000 generated paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xiiano
left a comment
There was a problem hiding this comment.
Copilot IDE:
Task completed:
Reviewed PR #8045 against main. Found no high-confidence bugs or memory-safety, Vulkan/SPIR-V, or repository-convention violations in the actual branch diff. The optimized in-place parsing preserves component, root, separator, and colon handling; T scratch setup preserves the prior last-error value and correctly avoids repeated directory creation. The synthetic reference test and CMake/CTest wiring match the repository patterns. Local build/test execution was unavailable because no C++/CMake tools are installed in the accessible environment.
|
Tested
AI-assisted (Claude Code). Synthetic test only, no game files. |
Item: PERF-FS-PARSE (claimed in #7913)
What
runtime/shims/file_system.cppparsed every console path (G:/T:/C:\) with several heap allocations and copies before the real filesystem call:console_drivecompared theGAME:prefix through a lowered substring.G:/T:paths, both roots were copied out of the lock andlies_underlowered copies of the path and of each root.parse_consolegrew each component a character at a time and copied it intoparts.T:path ranstd::filesystem::create_directorieson the scratch folder, whose status opens a handle to it.Now the prefix and roots are compared in place (roots under
g_mutex), components are sliced from the path, andcreate_directoriesonly runs whenGetFileAttributesWdoes not report the folder. The parse result is unchanged; behaviour is meant to be identical.Numbers (parse step only,
-O2)G:T:C:\Whole
GetFileAttributesW: only −5 to −12%, because the OS filesystem probes dominate. The win is real but small end to end; it is mostly CPU and allocator pressure on a call the game makes very often.Tests
file_system_test: 446/446 passed.runtime/test/file_system_parse_test.cpp(wired intoruntime/CMakeLists.txt): compares the new parse with the earlier code on edge cases, 272/272 passed, plus 200,000 generated paths with no differences.clang++ -O2.Conflicts
Checked against #7672, #4965, #3962, #7099 and #5234: no overlapping hunks. Other open
file_systempull requests were not compared line by line.AI-assisted
This change was written with AI assistance (Claude) and reviewed and tested as above. No game data is used; the test builds its paths by hand.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
🤖 Generated with Claude Code