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

Re-enable Optimizations for macOS Builds #45638

Closed
jfcaron3 opened this issue Nov 26, 2020 · 3 comments · Fixed by #46083
Closed

Re-enable Optimizations for macOS Builds #45638

jfcaron3 opened this issue Nov 26, 2020 · 3 comments · Fixed by #46083
Labels
Code: Build Issues regarding different builds and build environments OS: macOS Issues related to macOS / OSX operating system

Comments

@jfcaron3
Copy link

The current macOS builds run extremely slowly even on relatively decent hardware: 2.2 GHz quad-core i7 with 8GB DDR3 RAM, dedicated graphics, and an SSD. Sleeping a night takes ~5 minutes of realtime and I walk away from my computer while it's happening. This isn't a fun way to play. I tried adding the "no fungaloids" mod and it didn't help.

I learned that the macOS builds have optimizations turned off (-O0) because the clang that came with XCode on older (<=10.11) versions had a bug and couldn't support std::function with any optimization turned on. Maybe at the time this was OK if the game had less features enabled by default or less complexity. 10.11 is now two years past end-of-life so I don't think it's reasonable to hamper contemporary macOS users with bad performance. We don't even know if anyone plays on 10.11.

I compiled the game for my system (10.13 fwiw) and it runs so much faster it's amazing. We should provide this experience for more macOS users.

The way this is handled in the Makefile used for the builds is a parameter OSX_MIN which is currently set to 10.7 (if using clang) or 10.5 (if using gcc). If OSX_MIN <= 10.11 then you get -O0. If OSX_MIN > 10.11 then you get -O3. Note that this is true for RELEASE=1 builds, I'm not talking about debug builds. I don't think OSX_MIN is used for anything else, so I think we should just remove all this logic from the Makefile.

Anyone running <=10.11 can still compile the game themselves and set -O0.

Relevant PRs:
#30714
#26564

@ZhilkinSerg ZhilkinSerg added Code: Build Issues regarding different builds and build environments OS: macOS Issues related to macOS / OSX operating system labels Nov 26, 2020
@akirashirosawa
Copy link
Contributor

Looks like a duplicate of #33034

@jfcaron3
Copy link
Author

Not quite a duplicate, this is aside from the graphical bug mentioned there, though they do discuss the performance of the 10.11-compatible builds.

The question is: why do we have a macOS build? Easy: it's for macOS users to be able to play without having to compile themselves. Currently I think all macOS users (even those running <= 10.11) are prevented from playing properly because of the -O0 thing. Currently all potential macOS users need to compile themselves to properly play, so this goes against the very purpose of providing a build. How many potential new players tried CDDA on their Macs and didn't give it a fair shake because of how slow everything was?

We should provide a build that actually works, and not worry about an outdated macOS version. Those deviant users are probably enthusiastic enough that they can compile CDDA themselves.

@actual-nh
Copy link
Contributor

I can confirm that a 2011 Mac Mini can run OS X 10.12. (Probably not anything higher, though... sigh.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments OS: macOS Issues related to macOS / OSX operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants