You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/10/21 15:30:39 UTC

[GitHub] [ignite] ymolochkov opened a new pull request #8384: IGNITE-12508 GridCacheProcessor#cacheDescriptor(int) has O(N) complexity

ymolochkov opened a new pull request #8384:
URL: https://github.com/apache/ignite/pull/8384


   Since CHMs with cache descriptors are widely used, I think it's better to use hash of cache name instead of an actual name. 
   
   My reasonings are:
   - hash is a one way function, therefore we can't revert hash to readable name, so having cacheId does nothing for us if we have CHM with cache names as keys;
   - hashing of String keys are done under the hood by CHM and then cached in string pool, so it incurs minimal overhead in terms of CHM algorithms, if any
   - since hashing is just a function to get a unique int for a string, so a hash of an int == that same int
   - all in all, we lose almost nothing in terms of performance, simultaneously we gain a lot when looking up values in a map, since it's complexity is constant time value
   - string and its hash are unique values (or they are ought to be anyway), so nothing changes in logic
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] ymolochkov closed pull request #8384: IGNITE-12508 GridCacheProcessor#cacheDescriptor(int) has O(N) complexity

Posted by GitBox <gi...@apache.org>.
ymolochkov closed pull request #8384:
URL: https://github.com/apache/ignite/pull/8384


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org