[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 0/5] unistr/u*-chr, unistr/u*-strchr: improve test coverage, opti
From: |
bonzini |
Subject: |
[PATCH 0/5] unistr/u*-chr, unistr/u*-strchr: improve test coverage, optimize |
Date: |
Tue, 20 Jul 2010 17:26:24 +0200 |
From: Paolo Bonzini <address@hidden>
Hi,
this series introduces more optimizations (basically a Boyer-Moore
algorithm without the table) in the u8_strchr and u8_chr functions.
The algorithm introduces a heavy slow-down on UTF-16. This is probably
due to the nature of the test, but I decided it is not worth optimizing
that case a lot.
While doing this I also improved the coverage of the functions.
Here are the timings:
test-u8-chr test-u8-strchr
before 1:00 1:07
after 0:46 0:42
The timings are obtained by modifying test-chr.h and test-strchr.h to
always search starting from the beginning of the input string (removing
the "prev" stuff, basically).
The patch series includes only the u8-chr.c changes, as I have to figure
out how to make u8_strchr safe for invalid characters while keeping the
optimization.
Some changes are just to make the code more similar between u8-chr.c and
u8-strchr.c, or between the various character lengths.
Paolo Bonzini (5):
unistr/u*-strchr: add tests
unistr/u*-chr, unistr/u*-strchr: prepare for multibyte tests
unistr/u*-chr, unistr/u*-strchr: test multibyte sequences
unistr/u*-chr, unistr/u*-strchr: test multibyte sequences more
unistr/u8-chr: use Boyer-Moore like algorithm.
lib/unistr/u8-chr.c | 129 ++++++++++++++++++++++++++------------
lib/unistr/u8-strchr.c | 96 ++++++++++++++++++++++-------
modules/unistr/u16-chr-tests | 1 +
modules/unistr/u16-strchr-tests | 23 +++++++
modules/unistr/u32-strchr-tests | 22 +++++++
modules/unistr/u8-chr-tests | 1 +
modules/unistr/u8-strchr-tests | 23 +++++++
tests/unistr/test-chr.h | 67 +++++++++++++++-----
tests/unistr/test-strchr.h | 127 ++++++++++++++++++++++++++++++++++++++
tests/unistr/test-u16-chr.c | 2 +
tests/unistr/test-u16-strchr.c | 33 ++++++++++
tests/unistr/test-u32-chr.c | 2 +
tests/unistr/test-u32-strchr.c | 33 ++++++++++
tests/unistr/test-u8-chr.c | 2 +
tests/unistr/test-u8-strchr.c | 33 ++++++++++
15 files changed, 513 insertions(+), 81 deletions(-)
create mode 100644 modules/unistr/u16-strchr-tests
create mode 100644 modules/unistr/u32-strchr-tests
create mode 100644 modules/unistr/u8-strchr-tests
create mode 100644 tests/unistr/test-strchr.h
create mode 100644 tests/unistr/test-u16-strchr.c
create mode 100644 tests/unistr/test-u32-strchr.c
create mode 100644 tests/unistr/test-u8-strchr.c
- [PATCH 0/5] unistr/u*-chr, unistr/u*-strchr: improve test coverage, optimize,
bonzini <=
- [PATCH 1/5] unistr/u*-strchr: add tests, bonzini, 2010/07/20
- [PATCH 2/5] unistr/u*-chr, unistr/u*-strchr: prepare for multibyte tests, bonzini, 2010/07/20
- [PATCH 4/5] unistr/u*-chr, unistr/u*-strchr: test multibyte sequences more, bonzini, 2010/07/20
- [PATCH 3/5] unistr/u*-chr, unistr/u*-strchr: test multibyte sequences, bonzini, 2010/07/20
- [PATCH 5/5] unistr/u8-chr: use Boyer-Moore like algorithm., bonzini, 2010/07/20
- Re: [PATCH 0/5] unistr/u*-chr, unistr/u*-strchr: improve test coverage, optimize, Bruno Haible, 2010/07/20