this optimization gives about 10x performance boost on systems that support BigInt, and about 2x on those that don't