[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-recutils] 0002-torture-performance-tests-for-finding-a-single-recor
From: |
Jose E. Marchesi |
Subject: |
[bug-recutils] 0002-torture-performance-tests-for-finding-a-single-recor.patch |
Date: |
Thu, 09 Aug 2012 23:19:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Hi Michał.
This patchset looks good.
>From a26b78d75409799c929aee5a31cbe1260349688c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= <address@hidden>
Date: Mon, 2 Jul 2012 14:14:40 +0200
Subject: [PATCH 02/18] torture: performance tests for finding a single
record.
Should be improved by indexing or lazy loading of record sets.
---
ChangeLog | 22 ++++++++++++
torture/utils/p-recsel.sh | 84 ++++++++++++++++++++++++++++++++++++++++++++
torture/utils/testutils.sh | 33 +++++++++++++++++
3 files changed, 139 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index c36c542..e59cd58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2012-07-02 Michał Masłowski <address@hidden>
+
+ torture: performance tests for finding a single record.
+ * torture/utils/testutils.sh (test_gen_rset_file): New function.
+ * torture/utils/p-recsel.sh: generate input files with multiple
+ record sets.
+ (recsel-200-records-single): New test.
+ (recsel-500-records-single): Likewise.
+ (recsel-1000-records-single): Likewise.
+ (recsel-10000-records-single): Likewise.
+ (recsel-20000-records-single): Likewise.
+ (recsel-200-records-quick): Likewise.
+ (recsel-500-records-quick): Likewise.
+ (recsel-1000-records-quick): Likewise.
+ (recsel-10000-records-quick): Likewise.
+ (recsel-20000-records-quick): Likewise.
+ (recsel-200-records-c-single): Likewise.
+ (recsel-500-records-c-single): Likewise.
+ (recsel-1000-records-c-single): Likewise.
+ (recsel-10000-records-c-single): Likewise.
+ (recsel-20000-records-c-single): Likewise.
+
2012-06-10 Michał Masłowski <address@hidden>
src,torture: support lazy parsing of record sets.
diff --git a/torture/utils/p-recsel.sh b/torture/utils/p-recsel.sh
index 38e07d9..4ed545e 100755
--- a/torture/utils/p-recsel.sh
+++ b/torture/utils/p-recsel.sh
@@ -37,6 +37,12 @@ test_gen_input_file 1000-records 1000 10
test_gen_input_file 10000-records 10000 10
test_gen_input_file 20000-records 20000 10
+test_gen_rset_file 200-records 200-records-many "a" "b" "c"
+test_gen_rset_file 500-records 500-records-many "a" "b" "c"
+test_gen_rset_file 1000-records 1000-records-many "a" "b" "c"
+test_gen_rset_file 10000-records 10000-records-many "a" "b" "c"
+test_gen_rset_file 20000-records 20000-records-many "a" "b" "c"
+
#
# Tests.
#
@@ -66,6 +72,84 @@ test_tool recsel-20000-records perf \
"" \
20000-records
+test_tool recsel-200-records-single perf \
+ recsel \
+ "-e 'field9 = \"value1999\"'" \
+ 200-records
+
+test_tool recsel-500-records-single perf \
+ recsel \
+ "-e 'field9 = \"value1999\"'" \
+ 500-records
+
+test_tool recsel-1000-records-single perf \
+ recsel \
+ "-e 'field9 = \"value1999\"'" \
+ 1000-records
+
+test_tool recsel-10000-records-single perf \
+ recsel \
+ "-e 'field9 = \"value1999\"'" \
+ 10000-records
+
+test_tool recsel-20000-records-single perf \
+ recsel \
+ "-e 'field9 = \"value1999\"'" \
+ 20000-records
+
+test_tool recsel-200-records-quick perf \
+ recsel \
+ "-q value1999" \
+ 200-records
+
+test_tool recsel-500-records-quick perf \
+ recsel \
+ "-q value1999" \
+ 500-records
+
+test_tool recsel-1000-records-quick perf \
+ recsel \
+ "-q value1999" \
+ 1000-records
+
+# Use bigger values to keep similar output size.
+
+test_tool recsel-10000-records-quick perf \
+ recsel \
+ "-q value19999" \
+ 10000-records
+
+test_tool recsel-20000-records-quick perf \
+ recsel \
+ "-q value199999" \
+ 20000-records
+
+test_tool recsel-200-records-c-single perf \
+ recsel \
+ "-t 'c' -e 'field9 = \"value1999\"'" \
+ 200-records-many
+
+test_tool recsel-500-records-c-single perf \
+ recsel \
+ "-t 'c' -e 'field9 = \"value1999\"'" \
+ 500-records-many
+
+test_tool recsel-1000-records-c-single perf \
+ recsel \
+ "-t 'c' -e 'field9 = \"value1999\"'" \
+ 1000-records-many
+
+test_tool recsel-10000-records-c-single perf \
+ recsel \
+ "-t 'c' -e 'field9 = \"value1999\"'" \
+ 10000-records-many
+
+test_tool recsel-20000-records-c-single perf \
+ recsel \
+ "-t 'c' -e 'field9 = \"value1999\"'" \
+ 20000-records-many
+
+
test_tool recsel-200-records-sex-regexp perf \
recsel \
"-e 'field4 ~ \".*04.*\"'" \
diff --git a/torture/utils/testutils.sh b/torture/utils/testutils.sh
index f09f76e..b728ae3 100644
--- a/torture/utils/testutils.sh
+++ b/torture/utils/testutils.sh
@@ -88,6 +88,39 @@ test_gen_input_file ()
fi
}
+# Copy an input file into one with named record sets.
+#
+# $1 => Name of the original file.
+# $2 => Name of the result file.
+# $3... => Names of the record sets.
+test_gen_rset_file ()
+{
+ # Check parameters.
+ if test "$#" -lt "3"
+ then
+ echo "error: testutils: invalid parameters to test_gen_rset_file"
+ exit 1
+ fi
+
+ orig_filename="$1.in"
+ filename="$2.in"
+
+ echo -n " Creating input file $filename ..."
+
+ if test -f $filename; then
+ echo " skipped"
+ else
+ shift 2
+ for rset in "$@"; do
+ echo "%rec: $rset" >> $filename
+ echo "" >> $filename
+ cat $orig_filename >> $filename
+ done
+
+ echo " done"
+ fi
+}
+
# Initialize the testing environment.
#
# $1 => Name of the test suite.
--
1.7.10
--
Jose E. Marchesi http://www.jemarch.net
GNU Project http://www.gnu.org
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-recutils] 0002-torture-performance-tests-for-finding-a-single-recor.patch,
Jose E. Marchesi <=