-
Notifications
You must be signed in to change notification settings - Fork 191
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
Support in-place operations #191
Comments
|
What is the scale of the numbers being multiplied? If allocation is a significant portion of the calculation, I'm guessing they are relatively small values to begin with. If one of the operands is only a single |
Switching to smallvec could also help if even the result is small enough, depending on how many digits we keep local. |
Yes, I think so. The project is RustPython, bigint is used for storing all the numbers, so I think most of the numbers would be pretty small. And smallvec may also help. |
Currently, operations on
BigInt
such asadd_assign
is not done in-place, but with the following implementation:which would be costly for more complex operations, due to frequent allocation/deallocation.
We already have some in-place operations for
BigUint
such asadd_assign
, can we support this forBigInt
as well? I'm not familiar with this so idk if it would be very difficult to do so.The text was updated successfully, but these errors were encountered: