perf: Optimize the hotpath by converting the perf output buffer to local_t