Skip to content

Conversation

pickfire
Copy link

Routes in path seemed to work with linear memory instead of needing the extra hash and tracking of prev_route_id, a Vec should work just fine while having the benefits of cache locality.

Motivation

Vec seemed to be able to fulfill routes without needing HashMap, as well as better cache locality.

Solution

Change PathRouter to use Vec.

Routes in path seemed to work with linear memory instead of needing the
extra hash and tracking of prev_route_id, a Vec should work just fine
while having the benefits of cache locality.
Copy link
Collaborator

@mladedav mladedav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good as it might simplify things though I would be surprised if cache locality played any measurable role here as HashMaps are also backed by a single allocation and I would be surprised if the interleaved u32s made much difference. Plus it's iterated over in just a few scenarios.

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.

2 participants