CPU profiling with Go's pprof on MacOS produces misleading results due to a long-standing MacOS issue with POSIX signal reporting. When profiling Dolt database performance, MacOS showed most CPU time in runtime.usleep and syscalls, while Ubuntu correctly identified the real bottleneck: unnecessary memory copies from passing large structs by value. Switching these structs to pointers yielded 5-21% performance improvements. The discrepancy stems from MacOS bias in attributing CPU time to syscalls rather than actual application code, making Ubuntu the recommended platform for accurate Go profiling.
Sort: