sseserver icon indicating copy to clipboard operation
sseserver copied to clipboard

explore optimized routing data structure

Open mroth opened this issue 7 years ago • 2 comments

Short on documentation and tests, and most likely contains grievous implementation errors in the corner cases since we aren't testing for them yet, but don't want to invest any time there until we're sure we can actually make a worthwhile performance difference here.

This is a case of "replace one line of code with hundreds of lines of code" so it needs to really really be worth it!

mroth avatar Jul 27 '18 00:07 mroth

Initial results on sseserver benchmarks: compare (Full output: https://gist.github.com/mroth/03d20624af1c79344aee52cdd7008048)

Not a slam dunk. While an improvement in sparse broadcast (which is likely the dominant use case), but dense broadcast is where emojitrack-gostreamer spends a lot of it's time, so I'd want to see us stay at least neutral there, not regress, especially for the added complexity.

Next step is actually looking at the implementation for performance gotchas outside of the data structure itself.

mroth avatar Jul 27 '18 00:07 mroth

Note to self: potentially look at https://github.com/dghubble/trie when/if revisiting this, which has a zero allocation path segmenter.

mroth avatar Dec 29 '21 15:12 mroth