[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177978#comment-13177978
 ] 

Hudson commented on ZOOKEEPER-1229:
-----------------------------------

Integrated in ZooKeeper-trunk #1413 (See 
[https://builds.apache.org/job/ZooKeeper-trunk/1413/])
    ZOOKEEPER-1229. C client hashtable_remove redundantly calls hash function 
(Harsh J via phunt)

phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1225919
Files : 
* /zookeeper/trunk/CHANGES.txt
* /zookeeper/trunk/src/c/src/hashtable/hashtable.c

                
> C client hashtable_remove redundantly calls hash function
> ---------------------------------------------------------
>
>                 Key: ZOOKEEPER-1229
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1229
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: c client
>    Affects Versions: 3.3.3
>            Reporter: Eric Abbott
>            Assignee: Harsh J
>            Priority: Trivial
>              Labels: newbie
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1229.patch
>
>
> hashtable_remove appears to call the hash function in consecutive lines. As 
> hash functions are generally cpu intensive, using the hashvalue returned from 
> the first call will result in a performance improvement.
> {noformat}
> void * /* returns value associated with key */
> hashtable_remove(struct hashtable *h, void *k)
> ...
>     unsigned int hashvalue, index;
>     hashvalue = hash(h,k);
>     index = indexFor(h->tablelength,hash(h,k));
>     pE = &(h->table[index]);
>     e = *pE;
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to