Skip to content

numpy.testing.assert_equal is highly inefficient for many equality tests #215

@machow

Description

@machow

Looking at the source, it doesn't seem that this function is really geared toward string comparisons. For example, the code below runs at very different speeds...

records = ['abc']*10000
records2 = ['abc']*10000

# compare
for ii in range(len(records)): records[ii] == records2[ii]

# vs
import numpy as np
np.testing.assert_equal(records, records2)
# or
for ii in range(len(records)): np.testing.assert_equal(records[ii], records2[ii])

Related to #189

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions