Swift Playgrounds 4 apparently uses debug build configuration

Hi there,

I found my simple ray tracer using concurrency on 8 cores of an A12 processor in my iPad quite slow compared to the same code running on Windows on only 2 cores. The latter was a release build and took a second the former 16 seconds. Using debug build on Windows yields 36 seconds.

I tried a hack in Package.swift and injected an unsafeFlag -O with .when(configuration: .debug) but it crashed compilation whereas other flags (e.g. -Onone) don't. I thus assume a bug in SP4 or compilation for production was intentionally not foreseen.

Can someone tell me if I'm right - or even better - how to get SP4 compile for production?

Regards, Jürgen.

Answered by otabuzzman in 709237022

Putting my app to TestFlight shows performance as expected. It thus seems to be true that SP4 uses debug configuration. I also came across _isDebugAssertConfiguration() on Stack Overflow (#24003291) which evaluates to true in SP4 and false in TestFlight. Regards, J.

Accepted Answer

Putting my app to TestFlight shows performance as expected. It thus seems to be true that SP4 uses debug configuration. I also came across _isDebugAssertConfiguration() on Stack Overflow (#24003291) which evaluates to true in SP4 and false in TestFlight. Regards, J.

Swift Playgrounds 4 apparently uses debug build configuration
 
 
Q