Skip to content

Lazily compute longestCommonX #28

@make-github-pseudonymous-again

Description

Currently there are still some extensions computation that could be avoided. For instance, here

for (const k of forwardStep(centerF, D, V, eq, li, lj, ri, rj, Delta0)) {
const x = V[centerF + k];
const y = x - (k + Delta0);
V[centerF + k] = longestCommonPrefix(eq, x, lj, y, rj);
if (k - Delta < -(D - parityDelta)) continue;
if (k - Delta > D - parityDelta) continue;
if (V[centerF + k] < V[centerB + k - Delta]) continue; // TODO this scans the snake twice

The value of V[centerF + k] is not needed until the end of the forwardStep loop if the k - Delta bound checks fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions