Skip to content

Slow hnf for integer matrices #35161

@tornaria

Description

@tornaria

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Did you read the documentation and troubleshoot guide?

  • I have read the documentation and troubleshoot guide

Environment

- **OS**: void linux
- **Sage Version**: 9.8

Steps To Reproduce

sage: import sage.matrix.matrix_integer_dense_hnf as hnf
sage: hnf.benchmark_hnf([50,100],32)
('sage', 50, 32, 1.9906130000000104),
('sage', 100, 32, 19.642045000000003),

Expected Behavior

hnf is fast

Actual Behavior

hnf is slow

Additional Information

Compare with

sage: hnf.benchmark_magma_hnf([50,100],32)
('magma', 50, 32, 0.02),
('magma', 100, 32, 0.06),

This is taken verbatim from the doctest of sage.matrix.matrix_integer_dense_hnf.benchmark_hnf which thus takes 20+ seconds (on a fast box) which is too long even for "long time" IMO. I'm not sure what this doctest is actually testing here. I want to believe that this used to be much faster, if so this is a speed regression.

I'll make a PR to change the doctest so it doesn't take that much time, while keeping this issue open so the speed regression is not lost.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions