I'm curious about which way is more accurate in the way traceview provides profiling such as sampling-based or trace-based. The documentation only talks about the overhead caused due to the two and in that context sampling-based is a better choice as it causes less over head (relative to the sampling frequency).
So the main question is that which one is more accurate or suitable for comparing various implementation of a function or two different functions?
My concern with sampling based method is that it may not catch a function which has execution time small that the inter-sample interval.
My personal observation: I tested the sampling-based method with various functions repeatedly. It records computationally expensive function properly with 1000 microseconds as a sampling interval, however, it misses out on the light-weight functions.