On the Pi 4 what is faster - the SD card or a USB flash drive?
-
I haven't seen any comparisons or benchmarks between the two for running retropie, all I've seen is talk about using an SSD through the USB 3.0, but what about just a normal USB 3 flash drive? I would've thought that would've been just as beneficial as the SSD but I've read conflicting information saying that USB (even through the 3.0 port of the Pi 4) is slower than the SD.
Does anyone know the truth?
-
@rva-818x-laystar it's impossible to say without providing your terms - what USB drive? what SD card? there's many different classes and so forth.
most will quote their read/write speed in the literature. i am not aware of any of any bottlenecks for the pi4. it was different for pi 3 - see here: https://retropie.org.uk/docs/Running-ROMs-from-a-USB-drive/ - the link to http://www.roylongbottom.org.uk/Raspberry Pi Benchmarks.htm#anchor21
but i think more pertinently, for pi emulation it doesn't really matter. other than the act of transferring roms to your device, and perhaps boot up speed, I/O doesn't really matter. emulators are never going to be bottlenecked by it in normal circumstances.
-
Well, assuming best SD Card and best USB flash drive
but i think more pertinently, for pi emulation it doesn't really matter. other than the act of transferring roms to your device, and perhaps boot up speed, I/O doesn't really matter. emulators are never going to be bottlenecked by it in normal circumstances.
I think I may have found an instance where it does matter.
In THPS2 on N64, the intro sequence is in-game engine where different skaters skate in different locations changing about every 10 seconds, everytime the game swaps to a new location, there's a long pause as if the emulator is loading the game from the SD card into memory (makes sense since it's loading a whole level each time it changes)
I'm guessing this is due to the read speed off the SD card being inadequate for this task. The N64 carts had a very high read speed so I think this makes sense.
-
@rva-818x-laystar it will be an emulation issue - the cart will be entirely loaded into RAM i would expect. it could be a performance issue of the memory or gpu as it has load in the new textures etc. the pi has quite poor system throughput.
-
oh damn that's a shame, I thought I could fix it with a good drive. I might see if I have a USB 3 flash drive laying around somewhere and test it just to be sure
-
OK for anyone else wondering - I've done the testing.
THPS2 - my benchmark game - on N64
Performance is the same or perhaps a little WORSE loading via USB instead of SD Card.
I am using the intro sequence of THPS2 on N64 as it has noticeable slowdown when loading in a new character and level and the intro music lags a lot (I'm aware actual gameplay works fine).
Second test - Layer Section on Sega Saturn -
again
Same or possibly WORSE performance when loading games via USB rather than using the micro SD card.
As far as I'm concerned, that's the end of it. USB loading provide no benefit at all in terms of performance and may actually drop performance in some cases.
-
@rva-818x-laystar could you provide the SD read/write speed (or class) and the same for the USB drive? I'm interested to see which is really best, as in the retropie doc they say SD cards tend more to corruption and sometimes speed can be better on fast USB drives... I have a spare SSD I may play with and do my own benchmarking ;)
-
I used a 3.0 sandisk ultra luxe and a sandisk ultra fit to test the USB 3.0 load speeds for roms (their benchmarks can be easily googled) - both were basically identical in performance.
I used a Kingston Canvas Select Plus and a Sandisk extreme 128GB to compare SD card load speed for roms.
In both cases, the SD cards outperformed the USB drives by a VERY noticeable margin in game (i.e. less stuttering, less audio issues, less loading time, less slowdown, more FPS, etc.).
In all honestly, I don't 100% understand it because other websites and people have done tests and found that SSDs connected to the Pi via an enclosure and a USB 3.0 connection somehow outperform the SD card, but I was perplexed how the SSD in an enclosure would perform better than a simple USB drive plugged in (both being USB 3.0)????
Anyway, as far as my testing goes, the best performance I was able to obtain was from a micro SD card (I never tested an SSD in a USB 3.0 enclosure as I don't have one spare).
I paid about 10% extra for the 'extreme' version of the micro sd card (150MB/s vs 100MB/s) but honestly I couldn't truthfully tell the difference between SD cards, there appears to be little noticeable difference.
However, comparing SD card to USB card - night and day, completely different. micro SD crushes USB loading - now of course this could be due to the implementation of USB Rom loading - I genuinely don't know. I can only report the results of my testing with my USB drives and my micro SD cards.
-
In both cases, the SD cards outperformed the USB drives by a VERY noticeable margin in game (i.e. less stuttering, less audio issues, less loading time, less slowdown, more FPS, etc.).
the only rational explanation i have for this is that the USB drives were somehow causing undervolting via power drain (which still seems very unlikely), downclocking the system. there's simply no way in my mind that I/O is a bottleneck for in-game performance when everything is either in RAM already, or it's emulating an incredibly slow CD drive. i've alwaysed used a bottom-of-the-barrel USB 2.0 stick and it's never been a bottleneck (apart from loading and rom transfer, i suppose)
verbose logs of both scenarios would be useful. then you could see if frames were actually being dropped and by what margin, and if it's truly a like-for-like comparison, but hey, whatever works for you! :)
-
@rva-818x-laystar this helps a lot, thanks for sharing! I honestly don’t have a pi4 but a 3b so my ports are 2.0 (although I have a 3.0 case with a decent SSD), so I’ll stick to the SD for now, moving roms around as I don’t have much space on the SD. Also this makes it more portable :)
-
@retro81 On a Rpi3b you still may benefit with an SSD attached via an UASP compliant SATA adapter, although not as strong as via an USB 3.0 port. I never tried, so I can not tell if it would outperform a performant SD card.
For the SD card, TH has posted a rundown on selected cards: https://www.tomshardware.com/best-picks/raspberry-pi-microsd-cards
An SSD attached via UASP on a Rpi4 is a game changer (sorry for the pun). For booting and ROM loading-wise. This guy has examined the benefits of UASP for example.
FYI I use a UASP adapter from CSL Computer, was around 10 USD half a year ago, it works like charm and does not break the bank. If you go for one, don't order one with power supply (only needed for spindle disk / HDD).
-
@lolonois great stuff, thanks for sharing, I may give that try!
-
Sorry to bring up an older thread, but much of the information here is highly inaccurate and is mostly due to people buying cheap flash drives and SD cards which are very hit-and-miss. I've tested in my Raspberry Pi 4b 4gb a Samsung EVO Select 64gb Micro SD, Sandisk Ultra 16gb Micro SD, and Kingston Canvas Go Plus 64gb Micro SD and they don't come anywhere near the performance of my Sandisk Extreme 3.0 16gb USB flash drive.
Here is the Samsung EVO 64gb Benchmarks: https://pibenchmarks.com/benchmark/51099
And here is the Sandisk Extreme 3.0 (for some reason it was identified improperly by the benchmark program. This doesn't change the performance numbers): https://pibenchmarks.com/benchmark/51100Here is a link to the actual drive. https://www.amazon.com/SanDisk-Extreme-Flash-Drive-SDCZ80-016G-GAM46/dp/B00KT7DOR0
Booting from the Samsung Evo Select takes about 10 seconds longer than the Sandisk Extreme 3.0 usb stick.
That benchmark website pibenchmarks.com has tons of information on what drives are fast and what isn't. My USB 3.0 Samsung FIT drive is absolute hot garbage when running on a Pi 4. The fastest MicroSD cards do about 1700 points on the benchmark, There are USB sticks that score as high as 5,000 points. Then there are M.2 drives using USB 3 adapters which score over 10,000 points. Where USB Flash sticks and actual SSD/m.2 drives really excel is in the 4k random read/write tests which are the most important thing when it comes to performance.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.