Skip to content

Remove redundant snake computations#30

Open
ninioArtillero wants to merge 1 commit into
masterfrom
optimize-snakes
Open

Remove redundant snake computations#30
ninioArtillero wants to merge 1 commit into
masterfrom
optimize-snakes

Conversation

@ninioArtillero

Copy link
Copy Markdown
Collaborator

Current implementation (of dstep) deviates from the paper in that it extends each candidate along the available snake before comparing matching candidates.

This PR contains a refactoring that computes the extension along the snakes after matching candidates have been merged, thus voiding the computation of a significant amount of redundant snakes. Indeed, given that addsnake preserves a node's diagonal (as proved in #29), both candidates are know to be on the same diagonal before extending them, so we necessarily get the same result.

The change gives an improvent of ~40% reduction of cabal bench time (almost twice as fast), and cabal test passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant