Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualization.framework low Geekbench performance #1269

Closed
Sangeppato opened this issue Dec 28, 2022 · 8 comments
Closed

Virtualization.framework low Geekbench performance #1269

Sangeppato opened this issue Dec 28, 2022 · 8 comments

Comments

@Sangeppato
Copy link

Description

I've tried running Geekbench 5.4 from here on Lima using both Virtualization.framework and QEMU and on Docker Desktop using Virtualization.framework. The performance of Docker Desktop and QEMU are pretty much aligned, but Lima with VZ consistently lags behind.

Here are the numbers I got (in all the tests the VM has access to 4 cores and 8GB of RAM):

  • Lima QEMU:
    • Single: 1672
    • Multi: 5503
  • Lima VZ:
    • Single: 1225
    • Multi: 4191
  • Docker Desktop (Virtualization.framework):
    • Single: 1655
    • Multi: 5680

I apologize if this is a known issue or if I missed something in the configuration

@balajiv113
Copy link
Member

balajiv113 commented Dec 28, 2022

@Sangeppato
Can you try the benchmark with the current master (if not done already)

We have already done a vz specific improvement for disk performance in #1268

Also please add your machine details as well like Intel / M1.

@Sangeppato
Copy link
Author

@balajiv113
Sorry for the late reply. I've tried the current master (installing Lima with brew install --HEAD), but I got the exact same results.

@balajiv113
Copy link
Member

Thanks for the update. I was able to simulate this on my M1.

@balajiv113
Copy link
Member

Looks like rosetta is the culprit.
Only when rosetta is enabled there is a drop in performance.

Without rosetta - https://browser.geekbench.com/v5/cpu/19655316
With rosetta - https://browser.geekbench.com/v5/cpu/19655380

@Sangeppato
Copy link
Author

@balajiv113
Thank you, I can confirm your finding: the score is normal when Rosetta is disabled

@balajiv113
Copy link
Member

I ran crypto benchmark with a different tool cryptsetup benchmark as geekbench5 for arm is still in preview, ended with same result (drop in performance when rosetta is enabled).

With rosetta

#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b      1248.6 MiB/s      2118.0 MiB/s
    serpent-cbc        128b        92.0 MiB/s       104.0 MiB/s
    twofish-cbc        128b       168.1 MiB/s       220.6 MiB/s
        aes-cbc        256b       999.8 MiB/s      1977.8 MiB/s
    serpent-cbc        256b        92.7 MiB/s       104.0 MiB/s
    twofish-cbc        256b       169.5 MiB/s       220.7 MiB/s
        aes-xts        256b      1790.8 MiB/s      1799.6 MiB/s
    serpent-xts        256b        98.5 MiB/s       103.5 MiB/s
    twofish-xts        256b       217.9 MiB/s       222.4 MiB/s
        aes-xts        512b      1613.4 MiB/s      1610.6 MiB/s
    serpent-xts        512b        99.4 MiB/s       103.4 MiB/s
    twofish-xts        512b       220.1 MiB/s       222.6 MiB/s

Without rosetta

#     Algorithm |       Key |      Encryption |      Decryption
        aes-cbc        128b      1271.7 MiB/s      5786.8 MiB/s
    serpent-cbc        128b        92.0 MiB/s       104.0 MiB/s
    twofish-cbc        128b       173.4 MiB/s       220.7 MiB/s
        aes-cbc        256b      1017.3 MiB/s      5309.8 MiB/s
    serpent-cbc        256b        92.7 MiB/s       104.1 MiB/s
    twofish-cbc        256b       175.0 MiB/s       220.8 MiB/s
        aes-xts        256b      3776.2 MiB/s      3791.3 MiB/s
    serpent-xts        256b        98.5 MiB/s       103.5 MiB/s
    twofish-xts        256b       218.2 MiB/s       222.2 MiB/s
        aes-xts        512b      3486.9 MiB/s      3495.8 MiB/s
    serpent-xts        512b        99.5 MiB/s       103.5 MiB/s
    twofish-xts        512b       220.2 MiB/s       222.6 MiB/s

From above results aes-xts is performing 2x slow in rosetta.

@balajiv113
Copy link
Member

Official response from Apple

This is expected behavior. The Apple Silicon features required for Rosetta have an impact on the virtual machine execution of memory operations. The guidance is to only use Rosetta support as needed.

@Sangeppato
Copy link
Author

Official response from Apple

This is expected behavior. The Apple Silicon features required for Rosetta have an impact on the virtual machine execution of memory operations. The guidance is to only use Rosetta support as needed.

Thank you @balajiv113, that was an interesting discovery.
I guess this issue can be closed, then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants