Skip to content

Make TLND go 100x faster - #1

Open
jart wants to merge 1 commit into
SEL-Columbia:masterfrom
jart:100x-speedup
Open

Make TLND go 100x faster#1
jart wants to merge 1 commit into
SEL-Columbia:masterfrom
jart:100x-speedup

Conversation

@jart

@jart jart commented Jun 17, 2023

Copy link
Copy Markdown

This change improves performance by hoisting a maxDistFromNode() call out of an inner loop, which caused a 90x gain. The remaining speedups were due to precomputing buildAssocDict(), and using a set() to track visited nodes during a depth-first search. This change also cleans up object protocol methods on Node and Seg, to improve readability while offering modest performance gains.

This change improves performance by hoisting a maxDistFromNode() call
out of an inner loop, which caused a 90x gain. The remaining speedups
were due to precomputing buildAssocDict(), and using a set() to track
visited nodes during a depth-first search. This change also cleans up
object protocol methods on Node and Seg, to improve readability while
offering modest performance gains.
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