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
digits,exact_log,ndigits speed overhaul #5732
Comments
comment:1
Some timings:
I really like the first example :), but it's a bit of a pathology. There's a relatively narrow band of cases where the log base 2 estimate is quickly provable and exactly correct. |
comment:3
This is quote a nice speedup, but unless it gets reviewed soon it will not be in 3.4.1. Since I do not consider this a blocker I am reassigning this to 3.4.2 until it gets a review. Cheers, Michael |
Attachment: digits_exact_log_comprehensive.patch.gz rebased against 4.0 |
comment:4
I've tested the code using:
for all sorts of values m, n, k, small large, etc. Everything passes. The documentation is sufficient, the code reads well and appears correct. There are doctests. It is also fast as advertised:
Old sage 4.0:
new times with patch:
|
comment:5
Merged in 4.0.1.rc0. |
Reviewer: Bill Hart |
Author: Joel Mohler |
Merged: 4.0.1.rc0 |
The Integer.exact_log method is very slow for small input simply because it has never been optimized for this usage. The attached patch provides a specialized case for small input to exact log. It also adds a super-fast path for cases when the exact_log can conveniently be computed by log 2 estimation.
Component: basic arithmetic
Author: Joel Mohler
Reviewer: Bill Hart
Merged: 4.0.1.rc0
Issue created by migration from https://trac.sagemath.org/ticket/5732
The text was updated successfully, but these errors were encountered: