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

Improve benchmark #2

Open
GravisZro opened this issue Sep 5, 2021 · 2 comments
Open

Improve benchmark #2

GravisZro opened this issue Sep 5, 2021 · 2 comments

Comments

@GravisZro
Copy link

Time is a lousy benchmark, especially with a low numbers of elements running on an OS. There a lot of way of profiling but I would suggest using an LLVM based profiling solution like this one because it measures the number of intermediate language instructions executed. This avoids compiler/microcode optimizations and gives you the most representative output for all platforms.

@scandum
Copy link
Owner

scandum commented Sep 24, 2021

Wouldn't that fail to measure things like cache misses and branch mispredictions? It would be a useful metric to keep track of though.

What I have currently is within 1% accurate by measuring the best run out of 100. For low numbers of elements the number of repetitions can be increased to reduce the relative overhead of gettimeofday().

@GravisZro
Copy link
Author

The idea is to measure the speed of the algorithm without regard to machine it runs on, specifically because not all machines are created equal. It's fine to have "real world" results as well (though I would include more platforms) but nothing about them are empirical.

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

2 participants