-
-
Save clayg/d46146719c4412fedb02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Najc, | |
Did you read part 2 of Greg's retelling of the design lessons learned when building swift's ring implementation? Because it specifically addresses this deficiency in the naive approach. | |
It's maybe too bad Greg didn't carry the balancing issue into the "final" example because then we all have to continue to think for ourselves; but I'm sure he never expected anyone to copy and use that code as is. Having gone through it a few times myself, I always enjoyed it as just a collection of exercises to help the reader build up some intuitive models for the different issues at hand - I certainly don't have delusions that I'm going to reimplement a "simpler" version of Swift's ring using some code I copied of a blog post as a starting point. | |
Unfortunately, the code in your gist is just calling build_ring twice, which has a shuffle in there for dispersion, but when you do that you get two unrelated rings rather than rebalancing the first one with additional capacity. Maybe we could petition Sam to write a followup based on the last example with weights that includes a rebalance implementation that uses the weights to gather up a minimum number of parts to be reassigned. You may already be working on something like - maybe you can share!? | |
-Clay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment