Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark is using a bad method for time calculation #368

Open
vault-thirteen opened this issue Dec 5, 2023 · 0 comments
Open

Benchmark is using a bad method for time calculation #368

vault-thirteen opened this issue Dec 5, 2023 · 0 comments

Comments

@vault-thirteen
Copy link

Usage of RDTSC in C code in the year 2023 has several negative effects.

  1. TSC cannot be relied upon to provide accurate results — unless great care is taken to correct the possible flaws: rate of tick and whether all cores (processors) have identical values in their time-keeping registers.
    https://en.wikipedia.org/wiki/Time_Stamp_Counter

  2. The RDTSC CPU instruction is supported mostly on CPUs of Intel x86 architecture and their derivatives such as AMD64. This makes benchmarking useless on CPU having following architectures – ARM, MIPS, POWER, RISC-V, SPARC and others. It is also useless on virtual ISA's such as WebAssembly. All this makes the C code unportable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant