Have you done a prototype and tested it to see if it improves performance?

"Inefficient" is a relative term.  The difference in .3 billionths of a 
second and .6 billionths of a second (rough numbers from a quick test)
is huge percentage wise, but only makes a difference in a tight loop 
around that operation.  if there are other operations taking a million times
as long (such as the network calls it's making after it uses the hash), 
I suspect you won't be able to measure a difference.

-Dennis

On 08/29/2013 07:35 AM, Manik Surtani wrote:
> The Hot Rod protocol current passes the size of the hash space used to 
> clients, so that clients are able to create a consistent hash and perform 
> smart routing.
>
> https://docs.jboss.org/author/display/ISPN/Hot+Rod+Protocol+-+Version+1.0#HotRodProtocol-Version1.0-HashDistributionAwareClientTopologyChangeHeader
> https://docs.jboss.org/author/display/ISPN/Hot+Rod+Protocol+-+Version+1.2#HotRodProtocol-Version1.2-HashDistributionAwareClientTopologyChangeHeader
>
> However there are no rules as to what this hash space is, and this forces 
> clients to use the remainder operation when performing modular arithmetic.  
> This has been proven to be inefficient [1] [2] [3], and can be greatly 
> improved if we made a simple assumption that the hash space will always be a 
> power of two.
>
> Perhaps something we can add in v1.3 of the protocol, so that clients talking 
> to a server using Hot Rod 1.3 can make the assumption that the hash space is 
> a power of 2?
>
> WDYT?
>
> - Manik
>
>
> [1] 
> http://dhruba.name/2011/07/12/performance-pattern-modulo-and-powers-of-two/
> [2] 
> http://scicomp.stackexchange.com/questions/187/why-is-division-so-much-more-complex-than-other-arithmetic-operations
> [3] http://disruptor.googlecode.com/files/Disruptor-1.0.pdf (Page 5, last 
> paragraph)
>
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to