Optimized Arm builds?


Is it possible to create optimized Arm builds that is more efficient with memory, battery and cpu usages?

Currently the arm builds I tried whether the one with Android app or the Arm build uses alot of cpu. I know it works fine for some people but for my case it is never good enough. I have many syncs and many files to sync.

I am not a Go/Arm dev and I do not know much about this stuff so I am just trying to figure if there could be some improvement with the compile process.

To some extent, possibly. Go supports different instruction sets for ARM, see https://github.com/golang/go/wiki/GoArm. We build with GOARM=5 for compatibility.

I just had another go at ARMv8 builds for Android, and finally figured it out :slight_smile:

So the next version will have much faster hashing on new devices.

1 Like

How about memory related issues? I think most Go arm crashes happen due to memory with heavy syncs, at least that is my take based on people who are happy(they seem to sync couple files generally) vs people like me who ync larger folders.

Do you have any logs for those crashes?

The environment variable GOGC can be tuned to reduce memory overhead for the price of increased CPU overhead.

Would this cause any crashes? Do you think we should set a different default for Android, compared to what Syncthing does by default?

There’s also an open issue to set GOGC via the app settings. Contributions welcome!

We won’t crash by ourselves regardless how it’s configured, but I’m sure Android sets limits on memory usage and will kill us if they are exceeded. Tweaking down GOGC from the default of 100 to 50 or 25 will reduce our memory footprint, but increase CPU usage as it will run more frequent GC. Might get a few more miles out the few megabytes we are allowed, but if it’s a net positive or not depends, I guess. Test. :slight_smile:

I will be more than happy to test any arm builds of Syncthing, not the Syncthing app though if it is going to be frequent because it is pain in the butt to uninstall reinstall import profiles etc. However I have Syncthing running in the terminal and I can test out the arm builds frequently.

I can get crash log, it is just that I do not have any atm, I will see if other devices have any.

MY suspicion and my experience is that as the number of files to sync increase on Android , the instability increases with the Arm builds. As I tried to explain in my why I hate the android app thread, we have separate crashes with the app one that comes with the binaries and one with the gui app but they might look like the same thing for the user.

Anyway I sync like 50000+ files on my phone, go figure. So better mmemory management might be a good improvement with these binaries.