Comment

Comment by DavidBuchanan

> The main issue with RDTSC is that task-switches may cause your thread of execution to change cores or mess up your timing

I got around this by running my benchmarks in a kernel module, with interrupts disabled. Obviously this is only possible under certain circumstances.

I also disabled caching via the CR0 register for maximum repeatability, although of course that isn't at all reflective of "real world" performance, so it depends on what you're actually trying to measure.

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton