Wireshark mailing list archives

Re: Profiling results with optimized function ws_mempbrk_sse42() ws


From: Anders Broman <a.broman58 () gmail com>
Date: Thu, 5 Jun 2014 00:03:50 +0200

Den 4 jun 2014 23:29 skrev "Jakub Zawadzki" <darkjames-ws () darkjames pl>:

Hi,

On Wed, Jun 04, 2014 at 11:24:59AM +0000, Anders Broman wrote:
I did a test with
static inline const guint8*
guint8_pbrk(const guint8* haystack, size_t haystacklen _U_, const
guint8 *needles, guchar *found_needle)
{
                const guint8 *result = (const guint8
*)strpbrk(haystack, needles);

                if (result && found_needle)
                                *found_needle = *result;

                return result;
}

Which seems to give as good results on Ubuntu 13.10, it ends up using
__strpbrk_sse42 (libc-2.17.so: strcspn-c.c, ...)
==29458==
==29458== Events    : Ir
==29458== Collected : 21130728727
==29458==
==29458== I   refs:      21,130,728,727
Load time in WS 0:19.300

Yep, ws_mempbrk_sse42() is based on __strpbrk_sse42(), and it should give
similar results.
Still we must have binary (string, length) search, and strpbrk() works
correctly only for NUL terminated string.
Our tvb's are not NUL terminated, and strpbrk() won't skip over NULs, so
we need some modification.

Cheers,
Jakub.

Yeah,
I realised after writing The mail.
Anders

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org
?subject=unsubscribe
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: