- Home /
Question by
GloriaVictis · Oct 17, 2018 at 12:44 PM ·
profilerperformance optimizationprofilingsample
Profiler.BeginSample() performance - does it affect it while not profiling?
Hello,
As topic says - if I will cover my code around with Profiler.BeginSample(methodname) and of course EndSample will it decrease my code performance while having a Developement build but not profiling it?
Comment
Answer by Bunny83 · Oct 17, 2018 at 03:46 PM
Of course it always has some overhead. However it shouldn't be too much to worry about. Though you should make sure to not generate strings dynamically as this would produce additional garbage. Anyways profiling should be added temporarily when you actually debug / profile your game. So if you plan to keep the profiling code in your scripts you may wrap them with preprocessor tags.