-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
chore(Easings): Refactor #5108
base: nextgen
Are you sure you want to change the base?
chore(Easings): Refactor #5108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fail to see how this refactor is beneficial for readability or speed.
in my opinion, this code is more readable than before. speed is not affected & |
|
|
|
sry, my fuckup |
If you want a direct inline fun Easing.transform(x: Double) = transform(x.toFloat()).toDouble() |
The speed is affected, the class is now ~95% slower.
My setup was, with `EasingX` exchanged for the individual Easing class:
WARMUP_ITERATIONS = 4 MEASUREMENT_ITERATIONS = 8 Hardware: |
Actually this class was already refactored to be not like this in #4115 (the class used to be named |
@ccetl I think the benchmark is flawed. 4 warmup iterations is too few. The JIT compiler didn't even have a chance to compile the code. You probably tested the unoptimized, interpreted version. Those versions should be equivalent, otherwise there is a serious problem in the JIT implementation. Function pointers ( |
@superblaubeere27 I think the biggest problem is that Kotlin function interfaces will return |
You're right, but not only does it return an object at will also take an object that has to be covertet into primitives first before passing it down to the actual logic. |
No description provided.