From d124ac405cfa08152d1f440e8dbe479084a3d23e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Jun 2022 19:26:04 -0400 Subject: Update benchmarks --- README.md | 14 +- doc/serdi-memory.svg | 1919 +++++------------------------------------- doc/serdi-memory.txt | 11 + doc/serdi-throughput.svg | 2095 +++++----------------------------------------- doc/serdi-throughput.txt | 11 + doc/serdi-time.svg | 1868 +++++------------------------------------ doc/serdi-time.txt | 11 + scripts/serd_bench.py | 8 +- 8 files changed, 723 insertions(+), 5214 deletions(-) create mode 100644 doc/serdi-memory.txt create mode 100644 doc/serdi-throughput.txt create mode 100644 doc/serdi-time.txt diff --git a/README.md b/README.md index 76c80688..cae1c9f6 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Features than the C standard library. It is known to compile with GCC, Clang, and MSVC (as C++), and is tested on GNU/Linux, MacOS, and Windows. - * **Small:** Serd is implemented in a few thousand lines of C. It typically - compiles to about 100 KiB, or about 50 KiB stripped with size optimizations. + * **Small:** Serd is implemented in a few thousand lines of C. When optimized, + it compiles to well under 100 KiB. * **Fast and Lightweight:** Serd can stream abbreviated Turtle, unlike many tools which must first build an internal model. This makes it particularly @@ -33,15 +33,16 @@ Features specification, and includes many additional tests which were written manually or discovered with fuzz testing. The test suite is run continuously on many platforms, has 100% code coverage by line, and runs - with zero memory errors or leaks. + with zero memory errors or leaks. Code quality is continuously checked + statically by [clang-tidy][], and dynamically by various clang sanitizers. Performance ----------- The benchmarks below compare `serdi`, [rapper][], and [riot][] re-serialising -Turtle data generated by [sp2b][] on an i7-4980HQ running Debian 9. Of the -three, `serdi` is the fastest by a wide margin, and the only one that uses a -constant amount of memory (a single page) for all input sizes. +Turtle data generated by [sp2b][] on an AMD 1950x. Of the three, `serdi` is +the fastest by a wide margin, and the only one that uses a constant amount of +memory for all input sizes. ![Time](doc/serdi-time.svg) ![Throughput](doc/serdi-throughput.svg) @@ -74,6 +75,7 @@ should preserve). To build against serd, use the pkg-config package `serd-0`: [NQuads]: https://www.w3.org/TR/n-quads/ [Free Software]: http://www.gnu.org/philosophy/free-sw.html [ISC license]: http://opensource.org/licenses/isc +[clang-tidy]: https://clang.llvm.org/extra/clang-tidy/ [rapper]: http://librdf.org/raptor/ [riot]: https://jena.apache.org/ [sp2b]: http://www2.informatik.uni-freiburg.de/~mschmidt/docs/sp2b.pdf diff --git a/doc/serdi-memory.svg b/doc/serdi-memory.svg index f244f297..11d6ed1d 100644 --- a/doc/serdi-memory.svg +++ b/doc/serdi-memory.svg @@ -1,1747 +1,290 @@ - - - - - - image/svg+xml - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + - - - + - - - - + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + - - - + - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + - - - + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + - - - - - - - - - - - + + + + + - - - - + + + - - - - + + + - - - - - - - - - - - - + + + + + + - - - - + + + - - - - - - - - - + + + + + + + + - - - + + + diff --git a/doc/serdi-memory.txt b/doc/serdi-memory.txt new file mode 100644 index 00000000..82cac3a4 --- /dev/null +++ b/doc/serdi-memory.txt @@ -0,0 +1,11 @@ +n serdi rapper riot +1000000 1634304.0 492728320.0 589537280.0 +2000000 1523712.0 972505088.0 750370816.0 +3000000 1409024.0 1450397696.0 905318400.0 +4000000 1556480.0 1926307840.0 772521984.0 +5000000 1585152.0 2403586048.0 948658176.0 +6000000 1581056.0 2877878272.0 948121600.0 +7000000 1622016.0 3351150592.0 957530112.0 +8000000 1527808.0 3821490176.0 950579200.0 +9000000 1531904.0 4294303744.0 949751808.0 +10000000 1687552.0 4764184576.0 977002496.0 diff --git a/doc/serdi-throughput.svg b/doc/serdi-throughput.svg index d9f6236a..33654985 100644 --- a/doc/serdi-throughput.svg +++ b/doc/serdi-throughput.svg @@ -1,1925 +1,278 @@ - - - - - - image/svg+xml - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + - - - + - - - - + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + - - - - - + + - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + - - - - - - - - + + + + + - - + + + - - - - - - - - - + + + - - - - - - - - - + + + + + + - - + + + - - - - - - - - - - - - - - + + + + + + + + - - - + + + diff --git a/doc/serdi-throughput.txt b/doc/serdi-throughput.txt new file mode 100644 index 00000000..cb0d2678 --- /dev/null +++ b/doc/serdi-throughput.txt @@ -0,0 +1,11 @@ +n serdi rapper riot +1000000 833333 121654 87796 +2000000 843881 119189 130804 +3000000 835654 115651 150602 +4000000 852878 116482 169348 +5000000 863557 112309 174703 +6000000 845070 113981 182592 +7000000 838323 112377 190891 +8000000 854700 110314 193143 +9000000 837209 112107 205198 +10000000 829875 111321 203252 diff --git a/doc/serdi-time.svg b/doc/serdi-time.svg index 85f19d7f..30c1340e 100644 --- a/doc/serdi-time.svg +++ b/doc/serdi-time.svg @@ -1,1700 +1,276 @@ - - - - - - image/svg+xml - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + - - - + - - - - + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - + + + + + - - + + + - - - - - - - - - + + + - - - - - - - - - - - - + + + + + + - - - - + + + - - - - - - - - - + + + + + + + + - - - + + + diff --git a/doc/serdi-time.txt b/doc/serdi-time.txt new file mode 100644 index 00000000..dd0022bd --- /dev/null +++ b/doc/serdi-time.txt @@ -0,0 +1,11 @@ +n serdi rapper riot +1000000 1.2000000 8.2200000 11.3900000 +2000000 2.3700000 16.7800000 15.2900000 +3000000 3.5900000 25.9400000 19.9200000 +4000000 4.6900000 34.3400000 23.6200000 +5000000 5.7900000 44.5200000 28.6200000 +6000000 7.1000000 52.6400000 32.8600000 +7000000 8.3500000 62.2900000 36.6700000 +8000000 9.3600000 72.5200000 41.4200000 +9000000 10.7500000 80.2800000 43.8600000 +10000000 12.0500000 89.8300000 49.2000000 diff --git a/scripts/serd_bench.py b/scripts/serd_bench.py index 2ecaf8eb..683ce7c4 100755 --- a/scripts/serd_bench.py +++ b/scripts/serd_bench.py @@ -81,7 +81,9 @@ def plot(in_file, out_filename, x_label, y_label, y_max=None): matplotlib.use("agg") import matplotlib.pyplot as plt - fig_height = 4.0 + plt.rcParams.update({'font.size': 7}) + + fig_height = 1.8 dashes = get_dashes() markers = itertools.cycle(["o", "s", "v", "D", "*", "p", "P", "h", "X"]) @@ -115,8 +117,8 @@ def plot(in_file, out_filename, x_label, y_label, y_max=None): linewidth=1.0, ) - plt.legend() - plt.savefig(out_filename, bbox_inches="tight", pad_inches=0.025) + plt.legend(labelspacing=0.25) + plt.savefig(out_filename, bbox_inches="tight", pad_inches=0.125) plt.close() sys.stderr.write("wrote {}\n".format(out_filename)) -- cgit v1.2.1