Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

naive implementation of set difference #31

Open
dtaht opened this issue Oct 12, 2018 · 5 comments
Open

naive implementation of set difference #31

dtaht opened this issue Oct 12, 2018 · 5 comments

Comments

@dtaht
Copy link
Owner

dtaht commented Oct 12, 2018

This is the core of the xroute import problem. It's also similar to the resend problem. In both cases,
we could use a way better structure to deal with it, and probably the same kind. rb_tree?
I think avl would be better.

https://en.wikipedia.org/wiki/Red%E2%80%93black_tree#Set_operations_and_bulk_operations

https://github.com/dtaht/rabeld/blob/master/xroute.c#L355

@dtaht
Copy link
Owner Author

dtaht commented Oct 12, 2018

kernel rbtree is "augmented". Looks useful. It's GPL.

@dtaht
Copy link
Owner Author

dtaht commented Oct 13, 2018

this where resend goes nuts > 5k routes and desperately needs to not be a singly linked list. 36 byte compare too....

https://github.com/dtaht/babeld/blob/master/resend.c#L67

and the whole congestion control #11 and other issues #26 #20 with doing too much busty work would be better handled with a timer wheel.

@dtaht
Copy link
Owner Author

dtaht commented Oct 13, 2018

https://lkml.org/lkml/2005/10/19/46 was good

@dtaht
Copy link
Owner Author

dtaht commented Oct 23, 2018

I was not particularly happy with the overhead of an rbtree in these cases. So, reaching
back into prehistory, I went looking at various tries.

"Hardware/Software IP Lookups with Incremental Updates" was good reading:

http://cseweb.ucsd.edu/~varghese/PAPERS/ccr2004.pdf

with some example code here: https://github.com/xnhp0320/prefix_lookup_mc

@dtaht
Copy link
Owner Author

dtaht commented Nov 24, 2018

The uthash version seems performant.

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

No branches or pull requests

1 participant