Curiously or maybe even weirdly, the library is 5+ times faster on a Ubuntu ARM in VM in M1 than native M1.
Anyone know why this is happening ? Can a VM be faster than native ?!
@subins2000 An uneducated guess would be, the compiled go package/library is somehow *slower* on darwin/osx than on linux. Assembly produced might be inefficient/non-optimised, possibly?
@rajeesh That must be it cause there's no significant speed difference between Intel i5 8th gen and M1.
The speed is only visible for Linux on M1 VM but at a very high magnitude!
@rajeesh @sajith @subins2000 VMs can match native speeds when there is no binary translation/emulation needed. And with things like VT-d. The CPUs and other devises are usually passthrough and given directly to VMs. With IOMMU and MMU watching over memory accesses and CPUs trapping on privileged instructions.
In this case, I would suspect Darwin's compilation/assembly/optimization on ARM. Linux has been on ARM for a very long time and mature. And native binaries needs no translations.
ഫെഡറേറ്റഡ് സോഷ്യൽ വെബ്ബിലെ മലയാളിക്കൂട്ടം.