Issues due to usage of profiler API in release variant

I forgot some calls to profiler.scope_begin/profiler.scope_end in the code for a release bundle and things started behaving really strange. The factories weren’t working unleas they were collection factories, but still, only some of the collection factories worked, and depending if I was creating in init or update etc. etc. So really strange and hard to debug problems.

I know the documentation says that the release variant doesn’t contain the profiler but is this behaviour expected or is it an issue?
Also, could we get a warning when we use functionality that’s not available in the release variant?

You can guard profiler functions to avoid any problems using if profiler then.
Strange behaviors are probably caused by errors from profiler.scope_begin, etc.

3 Likes