twitter/algebird — pull request #390 by avibryant (2014-12-31 01:57:25+00:00)
Title: CMSItems

Adds a `CMSItems[K]` implementation of `CMS[K]` which, like `CMSItem[K]`, is exact, but for a small set of keys instead of just one.

You can add `CMSItem` and `CMSItem` or `CMSItems` and `CMSItems` and get a `CMSItems`. At a certain threshold (currently set to 100 items), this will transition to a `CMSInstance[K]`.

I haven't updated the TopN or TopPct variants, just the basic CMS.

I have a specific need for this, but it seems like a generally useful optimization. It could *probably* entirely replace `CMSItem` but I wouldn't want to do that without benchmarking first, which I have not done.

Thoughts @johnynek @miguno?