diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-02-06 13:52:37 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-02-11 09:14:50 +0000 |
commit | a837570d02dca2ad94ff5046b13592d84a12a345 (patch) | |
tree | 0a06b1d9a1c7c1e6bc67f57412f7adc3a2a1db71 /frame_tvbuff.c | |
parent | a618f1c0d63fd290cbdc93272beaf1ca7e838027 (diff) |
Combine SSE and pre-compiled patterns for faster pbrk
This combines the SSE4.2 instructions usage, with pre-compiled
pattern searching usage, for a faster pbrk search method.
Testing against large files of HTTP and SIP, there is about
a 5% performance improvement by using pre-"compiled" patterns
for guint8_pbrk() instead of passing it the search string and
having it build the match array every time.
Similar to regular expressions, "compiling" the pattern match array
in advance only once and using the "compiled" patterns for
the searches is faster than compiling it every time.
Change-Id: Ifcbc14a6c93f32d15663a10d974bacdca5119a8e
Ping-Bug: 10798
Reviewed-on: https://code.wireshark.org/review/6990
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'frame_tvbuff.c')
-rw-r--r-- | frame_tvbuff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frame_tvbuff.c b/frame_tvbuff.c index cc02722283..d70b053cae 100644 --- a/frame_tvbuff.c +++ b/frame_tvbuff.c @@ -139,13 +139,13 @@ frame_find_guint8(tvbuff_t *tvb, guint abs_offset, guint limit, guint8 needle) } static gint -frame_pbrk_guint8(tvbuff_t *tvb, guint abs_offset, guint limit, const guint8 *needles, guchar *found_needle) +frame_pbrk_guint8(tvbuff_t *tvb, guint abs_offset, guint limit, const tvb_pbrk_pattern* pattern, guchar *found_needle) { struct tvb_frame *frame_tvb = (struct tvb_frame *) tvb; frame_cache(frame_tvb); - return tvb_pbrk_guint8(tvb, abs_offset, limit, needles, found_needle); + return tvb_pbrk_pattern_guint8(tvb, abs_offset, limit, pattern, found_needle); } static guint |