Skip to content

Commit 992d484

Browse files
committed
perf: disable CWin32ReadOnlyFile to prevent duplicate stat calls
* when a file doesn't exist in a search path, then CWin32ReadOnlyFile can't open that file. and then we try yet another open in CStdioFile * technically, we could refactor the open code to be able to communicate an error code, but I didn't see much point to using Win32 specific files * I think there are some cases where not using CWin32ReadOnlyFile can break some demo playback on Windows, so I might either fix that or do the above
1 parent 3da9f79 commit 992d484

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/filesystem/filesystem_stdio.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ ConVar filesystem_unbuffered_io( "filesystem_unbuffered_io", "1", 0, "" );
240240
#define UseUnbufferedIO() true
241241
#endif
242242

243-
ConVar filesystem_native( "filesystem_native", "1", 0, "Use native FS or STDIO" );
244-
ConVar filesystem_max_stdio_read( "filesystem_max_stdio_read", IsX360() ? "64" : "16", 0, "" );
243+
ConVar filesystem_native( "filesystem_native", "0", 0, "Use native FS or STDIO" );
244+
ConVar filesystem_max_stdio_read( "filesystem_max_stdio_read", "64", 0, "" );
245245
ConVar filesystem_report_buffered_io( "filesystem_report_buffered_io", "0" );
246246

247247
//-----------------------------------------------------------------------------
@@ -417,7 +417,7 @@ FILE *CFileSystem_Stdio::FS_fopen( const char *filenameT, const char *options, u
417417

418418
CBaseFileSystem::FixUpPath ( filenameT, filename, sizeof( filename ) );
419419

420-
#ifdef _WIN32
420+
#if defined(_WIN32) && 0
421421
if ( CWin32ReadOnlyFile::CanOpen( filename, options ) )
422422
{
423423
pFile = CWin32ReadOnlyFile::FS_fopen( filename, options, size );

0 commit comments

Comments
 (0)