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

kernel: optimize LcmInt for small inputs #2159

Merged
merged 1 commit into from
Feb 9, 2018

Commits on Feb 7, 2018

  1. kernel: optimize LcmInt for small inputs

    This gives a tiny speed boost, but more importantly, avoids
    unnecessary allocation of temporary memory
    
    Before:
    
    gap> for i in [1..10000000] do LcmInt(2^50*13, 2^50*17); od; time;
    2655
    gap> for i in [1..10000000] do LcmInt(2^60*13, 2^60*17); od; time;
    4450
    gap> for i in [1..10000000] do LcmInt(2^70*13, 2^70*17); od; time;
    5831
    
    After:
    
    gap> for i in [1..10000000] do LcmInt(2^50*13, 2^50*17); od; time;
    2381
    gap> for i in [1..10000000] do LcmInt(2^60*13, 2^60*17); od; time;
    4505
    gap> for i in [1..10000000] do LcmInt(2^70*13, 2^70*17); od; time;
    5854
    fingolfin committed Feb 7, 2018
    Configuration menu
    Copy the full SHA
    6391c4f View commit details
    Browse the repository at this point in the history