Streamline PerfSample.

- Avoid memory allocations by making PerfSample a struct, and tracking ticks manually rather than creating a Stopwatch instance.
Merge pull request #5602 from RoosterDragon/perfsample-streamline

Streamline PerfSample