ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1229

C client hashtable_remove redundantly calls hash function

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.5.0
    • Component/s: c client
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      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.

      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;
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Harsh J
            Reporter:
            Eric Abbott
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development