Burst: Added an OptimizeFor option to [BurstCompile], allowing users to say they want fast code, small code, or fastly compiled code.
Burst: Assemblies are now allowed to have an [assembly: BurstCompile()] attribute to let users specify compile options that should apply assembly wide (for instance [assembly: BurstCompile(OptimizeFor = OptimizeFor.FastCompilation)]).
Is this in some way bound to the build configuration (debug/release/master, editor)?
I’m asking because when I iterate in the editor or build a debug Player, I’d prefer OptimizeFor.FastCompilation. When I build a release/master Player, I’d prefer OptimizeFor.Fast.
I don’t really care about the compilation times with Burst at all, but I do care about this:
There totally should be a way to set the default for player (in Burst AOT Settings) and default for editor. You can’t expect everyone to put extra boilerplate on code for every place where you use BurstCompile, that’s just not cool at all.
Yes, we agree. That’s why you should keep OptimizeFor.Default for most of the cases, because that will be the one that we will be able to redirect easily to Fast or FastCompilation. If you explicitly set it to something different from Default, we won’t be able to change it.
The changes are in Burst 1.6, so we should be able to land this as part of Burst 1.6 as it is a kind of usability bug fix. So hopefully in the coming weeks.
[Edit] Note that Burst 1.6 is still in RC (release candidate) until 2021.2 is final and we will likely have several RC before a final version later this year.