privacy.sexy icon indicating copy to clipboard operation
privacy.sexy copied to clipboard

Apple silicon processor support

Open AlexanderDankin opened this issue 10 months ago β€’ 8 comments

I really wish there was support for β€œM” series processors.

AlexanderDankin avatar Apr 25 '24 01:04 AlexanderDankin

Hi @AlexanderDankin,

I guess you mean the desktop application. It works fine on M processors for me. What issue did you have?

undergroundwires avatar Apr 25 '24 08:04 undergroundwires

There are no problems as such, except for the application taking too long to start up. I can only speculate, but maybe it's because the application is optimized for intel processors.

AlexanderDankin avatar Apr 25 '24 18:04 AlexanderDankin

There are no problems as such, except for the application taking too long to start up. I can only speculate, but maybe it's because the application is optimized for intel processors.

The app is build using ElectronJS which is a framework that utilize web technologies and therefore are not native in the traditional sense. So it lacks performance and is resource intensive

plantindesk avatar Apr 27 '24 14:04 plantindesk

The binary for macOS is x64, but this gets emulated on Apple that has performance impact:

Native apps run more efficiently than translated apps because the compiler is able to optimize your code for the target architecture. An app that supports only the x86_64 architecture must run under Rosetta translation on Apple silicon Apple Documentation

πŸš€ I just added System Requirements docs to clarify this: system-requirements.md.


Solution suggestion 1: Universal packages

So changing macOS releases to universal packages may help with the issue. This seems to be basically packaging ARM and x64 versions together in same file.

@plantindesk is right. Here is the electron-builder configuration. Luckily electron-builder supports universal packages:

  • Main issue: electron-userland/electron-builder#5475
  • Configuration examples with targeting both x64 and arm64: electron-userland/electron-builder#5689, electron-userland/electron-builder#5426
  • There seems to be universal option which makes it even better: electron-userland/electron-builder#5481

Solution suggestion 2: Do not show the white blank page

Another think we can do is to avoid showing white blank page while application is loading, see this blog post or this for visual examples.


What do you think?

undergroundwires avatar Apr 28 '24 10:04 undergroundwires

I think building both arm64 and x64 build for MacOS

plantindesk avatar Apr 28 '24 12:04 plantindesk

How about hiding the window until HTML/CSS/JS is loaded? I guess this should not be only macOS only but also be part of Windows/Linux versions. Do you see any side-effect having this on Windows/Linux?

I demonstrate this on Linux:

Now (with initial blank page) After (window hidden until loaded)
with-flash without-flash

undergroundwires avatar Apr 28 '24 13:04 undergroundwires

Thats best idea

plantindesk avatar Apr 28 '24 13:04 plantindesk

Off topic: Also you use Ubuntu 🫀 cause see this https://prism-break.org

image

plantindesk avatar Apr 29 '24 06:04 plantindesk

So hiding window until loaded is released as part of 0.13.3 πŸŽ‰

The packaged application is now arm64 (Apple Silicon) native. So it should run smoth now, feel free to verify this with 0.13.3 @AlexanderDankin.

It’s weird because I have never configured this arm64 build πŸ˜…. I guess this is because macOS GitHub runner (CI/CD) agents have been updated automatically to be ARM-based, and this resulted in ARM-only builds. I verify this by running file /Applications/privacy.sexy.app/Contents/MacOS/privacy.sexy command, which gives me:



/Applications/privacy.sexy.app/Contents/MacOS/privacy.sexy: Mach-O 64-bit executable arm64

This will break desktop application on all other Intel-based macs 🀦. So I will migrate to universal builds for macOS in 0.13.4.

I will also update desktop execution tests (which actually installs the software and ensures it runs OK), to run on both Intel and ARM-based macs to verify that it runs fine on both platforms.

undergroundwires avatar May 11 '24 13:05 undergroundwires

Thank you! Indeed the app started to open much faster.

AlexanderDankin avatar May 11 '24 15:05 AlexanderDankin

0.13.4 is just released πŸŽ‰ and it adds native support for both 64-bit and ARM. Thank you for the issue @AlexanderDankin.

undergroundwires avatar May 28 '24 10:05 undergroundwires