Wireshark-bugs: [Wireshark-bugs] [Bug 3973] New: addresse hash is slow on little endian CPU.
Date: Tue, 1 Sep 2009 20:21:39 -0700 (PDT)

           Summary: addresse hash is slow on little endian CPU.
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Wireshark
        AssignedTo: [email protected]
        ReportedBy: [email protected]

Build Information:
Paste the COMPLETE build information from "Help->About Wireshark", "wireshark
-v", or "tshark -v".
In epan/addr_resolv.c
The hostname cache uses the hash:
#define HASH_IPV4_ADDRESS(addr)        ((addr) & (HASHHOSTSIZE - 1))

On little endian CPU (x86) it's slow because addr is in host order thus 
'(addr) & (HASHHOSTSIZE - 1)' returns the network not the host.

I've found it while working on a capture with a lot of hosts, my old G4 (big
endian) was faster than a newer Pentium. As always O(n^2) beats Moore law.

HASH_IPV4_ADDRESS(addr) (ipv4_get_net_order_addr(addr) & (HASHHOSTSIZE - 1))
HASH_IPV4_ADDRESS(addr) (g_htnol(addr) & (HASHHOSTSIZE - 1))



Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.