From 0e0fbb53f9ec79450ff73c766491d2d1e2378492 Mon Sep 17 00:00:00 2001 From: Nathan Strong Date: Thu, 7 Jan 2021 21:06:07 -0800 Subject: [PATCH] Remove the path_is_valid() call when loading textures == DETAILS The `path_is_valid()` call ends up invoking `stat()`, which is unpredictable. It's practically free when implemented by an operating system (Linux, Windows), but on embedded systems it can be problematic. In the case of the Wii U, the stat() call actually ends up taking longer than the file I/O. And the texture loading code already handles a "file not found" case, so the stat() call ends up just being a waste of time. Removing this reduces the texture load time from ~210-250ms down to 60-65ms on average. --- gfx/gfx_display.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index a2be097dbb..1e81cda2db 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -1489,9 +1489,6 @@ bool gfx_display_reset_textures_list( fill_pathname_join(texpath, iconpath, texture_path, sizeof(texpath)); - if (!path_is_valid(texpath)) - return false; - if (!image_texture_load(&ti, texpath)) return false;