Re: Map Lexicoder

2015-12-29 Thread Keith Turner
Do you want all maps with the same keys to sort together? If so doing abc123 would make that happen. The map data below { a : 1 , b : 2, c : 3 } { a : 1 , x : 8, y : 9 } { a : 4 , b : 5, c : 6 } Would sort like the following if encoding key values pairs a1b2c3 a1x8y9 a4b5c6 If

Re: Map Lexicoder

2015-12-29 Thread Keith Turner
On Mon, Dec 28, 2015 at 11:47 AM, Adam J. Shook wrote: > Hello all, > > Any suggestions for using a Map Lexicoder (or implementing one)? I am > currently using a new ListLexicoder(new PairLexicoder(some lexicoder, some > lexicoder), which is working for single maps.

Re: Map Lexicoder

2015-12-29 Thread Matthew Hall
On Tue, Dec 29, 2015 at 04:53:47PM -0500, Adam J. Shook wrote: > a1b2c3 Most map serializations use this approach to maximize locality of reference in the CPU cache when serializing and deserializing. Matthew.

Re: Map Lexicoder

2015-12-29 Thread Adam J. Shook
Agreed, I came to the same conclusion while implementing. The final result that I have is a SortedMapLexicoder to avoid any comparisons going haywire. Additionally, would it be best to encode the map as an array of keys followed by an array of values, or encode all key value pairs back-to-back: