-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add support for BigInt in compiled mode #415
Comments
This is also another option:
GMP and and MPFR are also mentioned there, but I'll rule them out for now because of the (LGPL) licensing. It's not completely unlikely that I'll change the license for Perlang (to a split license where the compiler is GPL or AGPL and the stdlib is under another license), but I don't want to include LGPL or GPL:ed code at this stage. I want to retain the possibility to make the stdlib available under the MIT license, since I think this might be the most suitable option. |
This is now in place, and works, for a certain definition of "works", but... now that I've fixed #420, I realize how dog slow this stuff is. (or rather, seems to be. Very important note: I haven't benchmarked anything, so I don't know that the https://github.com/faheel/BigInt library is causing this.. but it seems likely, given the discussion in faheel/BigInt#69 (comment)). Running
|
There we go. With the changes in #425 in place, we are now down to something reasonable in compiled mode too. Bear in mind that this is just for calculating 1000 decimals now; the 10 000 decimal version is still not as fast as neither the C# nor JavaScript versions mentioned in our own docs, but I think it's "good enough" for now. If/when we need better performance than this, we'll have to investigate it further.
|
Fixed in #425. |
This (MIT-licensed) library seems useful: https://github.com/faheel/BigInt.
One challenge is that we haven't solved #378; where should bigints be allocated? From the stack? From the heap? Sometimes one and sometimes the other? To begin with, let's just allocate them on the heap and let the kernel/OS handle the cleanup for us. For static number constants, this will be the right choice anyway. For dynamically generated bigints, we obviously need something better but we'll keep this as part of the scope of #378 for now.
The text was updated successfully, but these errors were encountered: