You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Harsh J (Assigned) (JIRA)" <ji...@apache.org> on 2011/12/30 05:59:31 UTC

[jira] [Assigned] (ZOOKEEPER-1229) C client hashtable_remove redundantly calls hash function

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J reassigned ZOOKEEPER-1229:
----------------------------------

    Assignee: Harsh J
    
> 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
>         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