Skip to content
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

Sanity check signs of raw number before comparison #125

Merged
merged 1 commit into from Jun 22, 2022

Commits on Jun 22, 2022

  1. cty: sanity check signs of raw number before comparison

    This fixes a performance issue when comparing large numbers to zero (or
    large positive numbers to large negative numbers). Without this check,
    the numbers are both converted to text, and string compared, which is
    costly if the numbers are large.
    
    This patch provides a cheap early-exit option if the signs don't match,
    speeding up the cost of comparison to zero. As part of this, the .Modulo
    function calling .RawEquals should also have significantly improved
    performance (which was otherwise an expensive check for large numbers).
    jedevc committed Jun 22, 2022
    Copy the full SHA
    e2ccb97 View commit details
    Browse the repository at this point in the history