lemire/csharpewah — pull request #3 by ciaranj (2012-04-19 21:03:59+00:00)
Title: Reduce memory overhead for static maps

Possibly not an issue for most people, but I'm serializing a large number of smallish bitmaps (it may be I end up serializing a smaller number of large bitmaps, but for now it is as described.)

These bitmaps, once constructed are passed 'over the wire' and used for fast lookups, i.e. never change.

The provided commits help optimize a little for this use-case, but providing a 'Shrink' method that resizes the _Buffer field to the length of _ActualSizeInWords and ensures that it is called prior to serialization I no longer need to send down an excess of empty words (due to the buffer resizing)

Hope it's handy :)