box64 icon indicating copy to clipboard operation
box64 copied to clipboard

Very poor performance and spikes on Factorio

Open zoeleu opened this issue 3 years ago • 12 comments

Here are two benchmarks with and without box64, is this normal? Is this the expected performance or is there an issue I am not seeing?

https://browser.geekbench.com/v5/cpu/15195678 https://browser.geekbench.com/v5/cpu/15195624

I have also seen many hiccups and performance spikes with Factorio servers.

I am running Oracle Ampere A1 Server CPUs.

zoeleu avatar May 29 '22 20:05 zoeleu

My guess is that since Factorio is statically linked, Box64 can't find the native libraries to wrap and use.

zoeleu avatar May 29 '22 22:05 zoeleu

I don't really like the title of ticket. Why do you think this is "very poor" performance? GeekBench 5 is running at 40% of native speed, roughly. IIRC, the AES score is really low, even if box64 handle AES-NI extension using the AES aarch64 extension. Not sure why the score is so low. Do you have some better emulator maybe?

ptitSeb avatar May 30 '22 05:05 ptitSeb

I misformulated my issue, and for that I am sorry. The performance issues are with Factorio and I used geekbench statistics. My CPU spikes up to 400% at random moments and the players crash. This does not happen on an x86_64 CPU.

zoeleu avatar May 30 '22 22:05 zoeleu

Here is the headless build I am using: factorio.tar.xz

zoeleu avatar May 30 '22 22:05 zoeleu

Here is a list of symbols in Factorio. factorio_symbols.txt

It has a lot of statically linked libraries, I'm guessing this could be the root of the issue.

zoeleu avatar May 30 '22 22:05 zoeleu

Have you tried to update box64 latelly? I have improve stability, so I would expect the crash to be solved.

ptitSeb avatar Jul 03 '22 09:07 ptitSeb

Hmm, I'll try it soon

zoeleu avatar Jul 04 '22 16:07 zoeleu

FYI: I have improved the AES-XTS performance of Geekench 5 with latest commit.

Also, I suppose this ticket can be closed now.

ptitSeb avatar Sep 30 '22 18:09 ptitSeb

How would I diagnose performance issues on statically linked binaries?

zoeleu avatar Sep 30 '22 18:09 zoeleu

is that the same ticket?

if you are talking about binaries that use no external libs (no libc, no nothing), than box64 is not compatible with that.

ptitSeb avatar Sep 30 '22 19:09 ptitSeb

Originally this issue was about Factorio, the game, but I used Geekbench to showcase the performance downgrade for some reason I can't remember.

Yes, it uses libc dynamically, but glad and a couple other libraries related to cryptography (ssl, aes, tls) are statically linked, but not stripped. Does having a dynamically linked binary help with performance?

zoeleu avatar Sep 30 '22 21:09 zoeleu

Having dynamicaly linked libs helps performances only if the lib is wrapped in box64. glad is not wrapped for example, so static link is fine.

ptitSeb avatar Oct 01 '22 06:10 ptitSeb