implement stack profiler for measure method call performance