
A new video has just been released on YouTube, detailing a 6-month journey to "close the gap" between PS3 emulation on ARM and x86 (h/t: Retro Handhelds).
The dense new video, uploaded by the RPCS3 developer WhatCookie, is roughly 1 hour long and gets fairly technical, with the main takeaway for those who don't want to dive any deeper being that "PS3 emulation is now way faster on ARM."
"Today, we're able to emulate the PlayStation 3 60% faster while drawing 25% less power," WhatCookie states at the beginning of the video, showing a comparison between the performance six months ago and now.
In the video, they stated that, to do this, they scoured every page of an ARM Architecture manual with over 17,000 pages to "bring PlayStation emulation to a new class of devices," while also ordering an AYN Odin 2 and installing Linux on it to carry out the optimisations (as it was much cheaper than an ARM laptop with similar hardware).
As they go on to outline in the video, initial experiments with this device showed that they were spending half of their CPU on a four-line function, called Busy Wait, which exists to "improve performance in multi-threaded code."
According to WhatCookie, what this code does is check "if another thread changed a variable, over and over and over again in a loop", ensuring that the changes are identified quickly, but the trade-off is that it "burns more power" and "puts more pressure" on resources shared between different cores.
This actually managed to triple performance on x86 devices "under some pretty specific circumstances," but ended up being almost 150 times slower on ARM on the AYN Odin 2, due to the hardware timer running at 19MHz, as opposed to the "2 to 4GHz" found in many x86 devices.
The solution to this was to "scale the amount of time spent waiting [in the function] by the frequency of the timer," with WhatCookie stating "just fixing this bug alone provides a 25% boost to performance on average," on top of reducing power draw by 10%.
If you want to learn more, you can watch the full video below. This also details how the team used the ARM Yield instruction in place of the x86 Pause instruction, but eventually switched to the Instruction Synchronisation Barrier (ISB) after encountering issues, and outlines various other optimisations that led to performance gains. As WhatCookie states in the video description, you might want to "grab some food and get comfortable."




