Can't really compare the two as one is ARM (M1) and one is x86 (Ryzen 5000). An ARM CPU should have more instructions per clock but both do not run the same instruction sets as they are very different architectures. Its like comparing an apple to a mango. Yes both are fruits, but they are very different...
That said, Ryzen 5000 should be fastest in multi-threading as you have 6 - 16 very fast cores, each with SMT. Whereas the M1 should have one very fast core with the rest not as fast, so should be excellent with single threaded tasks. But remember they are different architectures, instruction sets, operating systems, power profiles, form factors, etc.
Going for one or the other would require us knowing what you want to do with it or what software it needs to run. Anything Apple-based makes M1 the default choice.
Edit: I see by your signature you are already firmly in the Apple camp...