in reply to Optimization Help
for (0 .. $#mapping) { return 0 if $self->{Matrix}[$row_index][$_] != $other->{Matrix}[$mapping->[$row_index]][$mapping->[$_ +]]; } return 1;
Update: The hash dereference could also take some microseconds if repeated many times. As $row_index does not change, you can assign the values to variables:
my $self_row = $self->{Matrix}[$row_index]; my $other_row = $other->{Matrix}[$mapping->[$row_index]]; for (0 .. $#mapping) { return 0 if $self_row->[$_] != $other_row->[$mapping->[$_]]; } return 1;
|
|---|