Skip to content

Conversation

burbas
Copy link
Contributor

@burbas burbas commented Mar 14, 2022

This commit makes it so we always are operating on binary strings which makes it much easier to have the same behaviour in lookup and insert.

Things left to do:

  • Compare the new and old way in regards to insert

Profiling of insert

Inserting 10 000 random paths with segment length=20 and number of segments=20 (/segment/segment/segment/...) results in the following runtime:

Old solution: ~1.6secs
New solution: ~3secs

This means that the new solution is a bit slower when it comes to inserting new routes. But since this is something that will only happen once or so I think that the upsides with this PR (Unified handling of insert/lookup) outweighs the slowdown.

@burbas burbas requested a review from Taure March 14, 2022 20:59
@burbas burbas added the enhancement New feature or request label Mar 14, 2022
@Taure Taure merged commit d93d528 into master Mar 14, 2022
@Taure
Copy link
Contributor

Taure commented Mar 14, 2022

As you say we do it once. If we need to make it faster we can look at it then.

@burbas burbas deleted the binary_tree branch October 13, 2022 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants