0

I am profiling my app (built with Codename One) using Xcode and an iPhone X device. I notice that, during heavy calculations (single- or multithreaded), sigprocmask and __sigaltstack (from libsystem_kernel.dylib) are the biggest time consumers with more than 20% each. That is a huge overhead. Does anyone know where this is coming from and if there is a way to reduce the overhead?

J-J
  • 419
  • 2
  • 12

1 Answers1

1

Not a huge expert on these but as far as I can tell they're low level kernel calls. I think both of these are profiler overhead so they won't be the top of the list if you run without a profiler.

Again, not an expert but this makes sense. The profiler needs to find out stuff about the current method and stack periodically.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks, yes that must be it. (I probably should have checked Call Tree > Hide system libraries.) At first I thought that the performance difference between profiling and running was only about 10-20%, but it appears that I also have to take the thermal state of the device into account, with runs of 1-2 minutes using 6 threads. Carefully testing (letting the device cool down after every run) I find an average performance difference of 40% between 'build for profiling; profile' and 'build for running; install; run'. That explains almost exactly the 2x 20% for the system functions when profiling. – J-J Jun 29 '21 at 11:17