java - Hazelcast ConcurrentMap / MultiMap Key -


I am declaring a multimate and want to know whether it is a good idea to keep the key in the form of an integer string As the key will accelerate to retrieve the values ​​with the key?

  Multimap & lt; String, order & gt; MmCustomerOrders = hz.getMultiMap ("Customer Order");   

versus

  multimap & lt; Integer, order & gt; MmCustomerOrders = hz.getMultiMap ("Customer Order");   

thx.

It may be slightly faster, encoding / decoding simple ASCII strings based on string length and complexity It's easy to do but if you have non ASCII characters then it will be a bit more complex. But even on integers there is a high chance that you have to keep making the whole thing since the values ​​are high, if you override the default integer cache size you can work around it (java. Lang.Integer .IntegerCache.high ". This increases the size of the integers before determining more than 127.

The question in the reality is that if you make real speed difference, then the serialization It just depends on the more I just try that there is no difference to you, otherwise I will see it as a timely adaptation. This will be different if your objects are very complex but do not give you real benefits for string and integer

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -