(Android) On Android all the async file I/O/image loading seems to

be actually detrimental to performance. So turn it off for now
(performance might have been better pre-SAF but it is what it is)
This commit is contained in:
U-DESKTOP-SPFP6AQ\twistedtechre committed 2026-04-14 16:47:55 +02:00
1 parent 5ee27095b6
commit b8c78609ee
2 files changed
+23

No files matched your search

+9
View File
@@ -53,6 +53,14 @@ static int task_file_transfer_iterate_transfer(nbio_handle_t *nbio)
iters = nbio->pos_increment ? nbio->pos_increment
: NBIO_DEFAULT_POS_INCREMENT;
#ifdef __ANDROID__
/* Android: complete the entire file read in one pass to avoid
* spreading I/O across frames, which causes menu freezes and
* icon glitches when combined with async image decoding. */
(void)iters;
while (!nbio_iterate(nbio->handle));
return -1;
#else
for (i = 0; i < iters; i++)
{
if (nbio_iterate(nbio->handle))
@@ -60,6 +68,7 @@ static int task_file_transfer_iterate_transfer(nbio_handle_t *nbio)
}
return 0;
#endif
}
static int task_file_transfer_iterate_parse(nbio_handle_t *nbio)
+14
View File
@@ -151,8 +151,16 @@ static int task_image_iterate_process_transfer(struct nbio_image_handle *image)
if ((retval = task_image_process(image, &width, &height))
!= IMAGE_PROCESS_NEXT)
break;
#ifndef __ANDROID__
/* On non-Android platforms, budget image processing across
* multiple frames to avoid blocking the UI thread.
* On Android this causes freezes and icon glitches with all
* menu drivers, so we complete the entire decode in one pass. */
}while (cpu_features_get_time_usec() - start_time
< image->frame_duration);
#else
}while (1);
#endif
if (retval == IMAGE_PROCESS_NEXT)
return 0;
@@ -350,8 +358,14 @@ bool task_image_load_handler(retro_task_t *task)
image->status = IMAGE_STATUS_TRANSFER_PARSE;
break;
}
#ifndef __ANDROID__
}while (cpu_features_get_time_usec() - start_time
< image->frame_duration);
#else
/* Android: complete transfer in one pass to avoid
* context contention causing freezes/glitches */
}while (1);
#endif
}
break;
case IMAGE_STATUS_PROCESS_TRANSFER_PARSE: