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

Changed Newton’s method to algebraic solution #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DmitryBaranovskiy
Copy link

I replaced the code with algebraic solution. Not only in increases precision, but apparently it is faster.

Old benchmark on my Macbook Pro looks like this

BezierEasing: instanciation x 18,211,751 ops/sec ±0.36% (93 runs sampled)
BezierEasing: call x 34,590,461 ops/sec ±0.18% (102 runs sampled)
BezierEasing: instanciation + call x 7,468,345 ops/sec ±0.26% (94 runs sampled)

The new one looks like this:

BezierEasing: instanciation x 40,143,156 ops/sec ±2.39% (96 runs sampled)
BezierEasing: call x 98,549,765 ops/sec ±0.22% (97 runs sampled)
BezierEasing: instanciation + call x 11,811,166 ops/sec ±1.21% (96 runs sampled)

So, I consider it a serious improvement. You can read about method in my blog post: http://dmitry.baranovskiy.com/bezier-easing.html

Thank you for writing a great library and inspiring my work. I hope, you will accept this change even though it’s quite dramatic.

Replaced search with algebra.
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

Successfully merging this pull request may close these issues.

1 participant