libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.32k stars 1.84k forks source link

Retroachievement causes save/load state delays #14717

Closed negativeExponent closed 1 year ago

negativeExponent commented 1 year ago

First and foremost consider this:

Description

When RetroAchievements are enabled, load/save states causes 2 problems 1. it takes awhile for the save/load widget to appear 2. make loading/saving states very slow.

Expected behavior

should be instantaneous

Actual behavior

see description

Steps to reproduce the bug

  1. enable retroachievement. load a game with achievements.
  2. load a state or save a state
  3. tested with mgba, vbam, pcsx_rearmed

Bisect Results

[Try to bisect and tell us when this started happening]

Version/Commit

You can find this information under Information/System Information

Environment information

Jamiras commented 1 year ago

Fixed in #14712

Jamiras commented 1 year ago

To clarify: There was a bug where the achievement badges were being redownloaded every time a game was launched. These downloads occur on the same task thread as the save state/load state processes, so while the task thread is blocked waiting on an HTTP response, the save/load cannot proceed.

This could still be an issue the first time a game is launched, as the badges do still have to be downloaded then. But the expectation is that the user won't save for at least a few minutes after starting a game, by which time the badges should all be downloaded. The problem was more prevalent when continuing from a load state in the next session.

To address the "first time" problem, either an additional task thread would be required so there wouldn't be any contention, or something needs to be done to the HTTP code so it doesn't use as much of the thread's time. Another option would be to gives tasks priorities so the HTTP tasks only execute if there are no other tasks.

negativeExponent commented 1 year ago

thanks for the fast reponse.

this issue is now fixed.