[m-rev.] for review: speed up find_closest_seq

Zoltan Somogyi zoltan.somogyi at runbox.com
Fri Jan 26 01:08:20 AEDT 2024


For review by Julien, since he reviewed the related earlier diff.

I am in two minds about the effect of this change on the speed
of find_edit_distance when invoked directly, i.e. not via find_closests_seq.
On the one hand, it it a slight slowdown, for the reason listed in the
log message. On the other, find_edit_distance should still be much faster
than it was two days ago, before my previous diff.

We *could* keep around the old code of find_edit_distance, which
does not have the overhead of computing the minimum cost in each row.
However, this would require at least some code duplication, and it would
not help the compiler, since the compiler *always* invokes find_edit_distance
through find_closests_seq, not directly. That's why this diff does not do that,
though I could be persuaded otherwise.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.ed2
Type: application/octet-stream
Size: 893 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240126/60d69632/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.ed2
Type: application/octet-stream
Size: 6237 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240126/60d69632/attachment-0003.obj>


More information about the reviews mailing list