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

Replace num-bigint with malachite-bigint #4952

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

qingshi163
Copy link
Contributor

No description provided.

Cargo.toml Outdated Show resolved Hide resolved
@youknowone

This comment was marked as resolved.

@youknowone
Copy link
Member

BigUint::parse_bytes seems rejecting _ in input, which is legal on num-bigint.

@qingshi163
Copy link
Contributor Author

Don't change bytes_to_int, malachite-bigint should handle it. I think it is a bug involved on the last commit

@qingshi163 qingshi163 marked this pull request as ready for review May 21, 2023 12:11
@youknowone
Copy link
Member

@qingshi163 Can we run a benchmark about this? A benchmark with many small int binary operations will fit.

@corona10
Copy link
Contributor

@youknowone @qingshi163
FYI for the Fibonacci benchmark


Mean +- std dev: [base] 60.0 us +- 2.0 us -> [pr_4952] 55.4 us +- 1.1 us: 1.08x faster
import pyperf

runner = pyperf.Runner()
runner.timeit(name="bench fib",
              stmt="""
_ = fib(10)
""",
              setup = """
def fib(n):
    if n == 0:
        return 0
    if n == 1 or n == 2:
        return 1
    return fib(n-1) + fib(n-2)
""")

@youknowone
Copy link
Member

@corona10 Thank you!

@DimitrisJim DimitrisJim linked an issue May 23, 2023 that may be closed by this pull request
@youknowone youknowone force-pushed the malachite-bigint branch 3 times, most recently from b5af178 to 91803f9 Compare June 2, 2023 13:42
@youknowone
Copy link
Member

hmm, this is unexpected. what's changed?

@youknowone
Copy link
Member

I can't locally reproduce it.

@youknowone
Copy link
Member

ah, main is already broken

@youknowone youknowone merged commit de0d323 into RustPython:main Jun 8, 2023
20 of 22 checks passed
@qingshi163 qingshi163 deleted the malachite-bigint branch July 22, 2023 20:25
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.

[RFC] Faster BigInt Implement via Malachite?
4 participants