-
-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
[Core] Optimize typedefs.h functions #91664
base: master
Are you sure you want to change the base?
Conversation
Can you please provide some details on what and how this was tested, under what conditions and what parts improved how |
What is Also at least some of the implementations aren't correct, see the windows run, so would be good to ensure all work correctly before benchmarking it Also would need benchmarking on all platforms where the code has changed, so we can tell it hasn't worsened |
Oh. Made new benchmarks where I initialized rand values. It turns out that before |
Please provide the full benchmarking code to replicate |
Edit: Oops, I made a mistake in the |
If you get different results with uninitialised values (and we don't know what values they are, depends on compiler and you code - assuming they are zeros because are global) and with randomly initialised values, 10k test pattern may be not enough to measure before-after difference for different inputs for before-after. |
It was just due to this check. if (p_number == 0) {
return 0;
}
Increased to 1 000 000.
|
Ran the provided code - I'm sure I might have done something wrong, but I got the following results: If results are actually valid, standard deviation for |
I think you had a system calls or something in the |
I don't think so, since these functions are independent of the data they are given. |
Have you confirmed this by the compiled code and the definitions of the operations? Just because they lack explicit branch statements doesn't mean they're data independent |
As I know, in general using different data for comparison tests is bad practice (because, for example, it could be used to get fake results (of course it's not our case)). Maybe it doesn't matter in this specific situation. |
16023fa
to
575aa87
Compare
575aa87
to
2da5b91
Compare
Optimized typedefs functions. Their performance improved 1.5 - 8 times.