Skip to content

NMatrix getter and setter way slower than Matrix #541

@lokeshh

Description

@lokeshh

I'm using NMatrix for competitive programming for a while now and I have found NMatrix to be slower than Matrix for most of my programs. For example methods such as [], []= which are frequently used in my programs are slower in NMatrix.

Here's a benchmark I ran and following are the results:

       user     system      total        real
Matrix getter  3.700000   0.020000   3.720000 (  3.744560)
NMatrix getter 12.930000   0.060000  12.990000 ( 13.065677)
Matrix setter  2.920000   0.020000   2.940000 (  2.965361)
NMatrix setter 16.600000   0.060000  16.660000 ( 16.889194)

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