On May 15, 6:17 pm, 0x6e6562 <
0x6e6...@gmail.com> wrote:
> I'd now like to add an
> index to the map to improve the query performance, but it is not clear
> to me from the API what call I should make. Is there an example
> somewhere of indexing the key of a map?
To an extent, I think I may have answered my own question empirically
- I constructed a stripped down test suite that can just be run with a
simple mvn test (
https://github.com/0x6e6562/hazelcase-key-index/blob/
master/src/test/java/com/acme/KeyIndexTest.java). This test indicates
a sublinear cost of querying the map using a predicate that matches on
the key portion of each MapEntry, without having to explicitly apply
an index to it.
I'm wondering whether somebody could confirm that this is the expected
behavior.
As a side note, my tests start off with inserting 200 elements into
the map, then ramp up to 200000 elements. If I go beyond that, I run
into an OutOfMemory error, which I assume is due to the fact that the
map has not been gc'ed, but I think that this kind of thing should be
discussed in a separate thread (and probably has been or is even in
the documentation somewhere).