Hacker News new | past | comments | ask | show | jobs | submit login

It depends on the implementation: https://cpucycles.cr.yp.to/counters.html

- default-perfevent: the kernel will keep track of counter values on core moves

- amd64-pmc: Accesses a cycle counter through RDPMC: best to pin the benchmark binary to a specific core to avoid measurement issues when the task moves between cores: "taskset -c 1 <benchmark-binary>"

- amd64-tsc, amd64-tscasm: RDTSC is off-core counter - not influenced by cross-core moves ("On current CPUs, this is an off-core clock rather than a cycle counter, but it is typically a very fast off-core clock, making it adequate for seeing cycle counts if overclocking and underclocking are disabled.")




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: