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 performance of long encoding #26

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

Conversation

jonhkr
Copy link

@jonhkr jonhkr commented Jan 25, 2025

I've made a few changes to improve performance.
The benchmark was run on a Apple M3 Pro, the old and new methods where executed 1M times each with value N.

Here is the result of the benchmark:

N Old New
0 260ms 237ms
-1 248ms 227ms
127 480ms 357ms
128 481ms 355ms
256 481ms 355ms
-256 485ms 356ms
65536 711ms 404ms
-65536 710ms 397ms
16777216 946ms 442ms
-16777216 947ms 447ms
4294967296 1184ms 474ms
-4294967296 1185ms 474ms
2305843009213693952 2065ms 623ms
-2305843009213693952 2088ms 626ms
4611686018427387904 2293ms 658ms
-4611686018427387904 2060ms 624ms
9223372036854775807 2278ms 661ms
-9223372036854775808 2299ms 663ms

@jonhkr
Copy link
Author

jonhkr commented Jan 29, 2025

@tPl0ch can you take a look please?

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