Posted by: leppie | October 13, 2009

Replaced BigInteger implementation with a faster one


I have recently checked in code that completely removes the usage (and in fact removes it from existence) of the DLR’s BigInteger implementation and replaces it with the IntX big number implementation.

The new code provides much better performance in terms of multiplication of very big numbers. Although I have not benchmarked it, I suspect the other operations are slightly faster too, given that quality of the implementation.

The ‘port’ was done in-place. First, the C# was modified and recompiled, then the bootfile was disassembled, and patched with the new type, and recompiled. Lastly, the new type was extended to make its interface (aka public methods) was compatible in terms of IL method signatures.

The rest, just involved some testing, and minor bug fixing. It should all work as before, and be completely transparent.

I did however come across a weirdass bug, where a case statement will fail to match. I couldn’t repro it at all, even after days of debugging/trying/crying….

Please notify me of any big number related bugs 🙂




Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: