aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-strrchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/bench-strrchr.c')
-rw-r--r--benchtests/bench-strrchr.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/benchtests/bench-strrchr.c b/benchtests/bench-strrchr.c
index 7cd2a15..3fcf3f2 100644
--- a/benchtests/bench-strrchr.c
+++ b/benchtests/bench-strrchr.c
@@ -151,7 +151,7 @@ int
test_main (void)
{
json_ctx_t json_ctx;
- size_t i, j;
+ size_t i, j, k;
int seek;
test_init ();
@@ -173,7 +173,7 @@ test_main (void)
for (seek = 0; seek <= 23; seek += 23)
{
- for (j = 1; j < 32; j += j)
+ for (j = 1; j <= 256; j = (j * 4))
{
for (i = 1; i < 9; ++i)
{
@@ -197,6 +197,30 @@ test_main (void)
do_test (&json_ctx, getpagesize () - i / 2 - 1, i, i + 1, seek,
SMALL_CHAR, j);
}
+
+ for (i = (16 / sizeof (CHAR)); i <= (288 / sizeof (CHAR)); i += 32)
+ {
+ do_test (&json_ctx, 0, i - 16, i, seek, SMALL_CHAR, j);
+ do_test (&json_ctx, 0, i, i + 16, seek, SMALL_CHAR, j);
+ }
+
+ for (i = (16 / sizeof (CHAR)); i <= (2048 / sizeof (CHAR)); i += i)
+ {
+ for (k = 0; k <= (288 / sizeof (CHAR));
+ k += (48 / sizeof (CHAR)))
+ {
+ do_test (&json_ctx, 0, k, i, seek, SMALL_CHAR, j);
+ do_test (&json_ctx, 0, i, i + k, seek, SMALL_CHAR, j);
+
+ if (k < i)
+ {
+ do_test (&json_ctx, 0, i - k, i, seek, SMALL_CHAR, j);
+ do_test (&json_ctx, 0, k, i - k, seek, SMALL_CHAR, j);
+ do_test (&json_ctx, 0, i, i - k, seek, SMALL_CHAR, j);
+ }
+ }
+ }
+
if (seek == 0)
{
break;