1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

bench: binary packet generation & results

This commit is contained in:
tg(x) 2011-05-24 17:37:00 +02:00
parent 7a8f1470df
commit 3e08a81abf
11 changed files with 100 additions and 35 deletions

1
bench/.gitignore vendored
View file

@ -1,3 +1,4 @@
*.html
*.pdf
results/
packets/binary/[0-9]*

View file

@ -7,7 +7,7 @@ INIT = (setq load-path (cons \"/usr/share/emacs/site-lisp/org-mode\" load-path)
org-babel-tangle-pad-newline nil \
org-src-preserve-indentation t) \
(require 'org-install)
#'
ORG = benchmark.org
html:

View file

@ -129,23 +129,42 @@ We'll use the latter here:
Parsing time of 1 000 000 packets, in milliseconds.
a simple strlen scan of the respective message is provided for comparison.
| input: | PSYC | | JSON | | | XML | |
| parser: | strlen | libpsyc | json-c | json-glib | libxml sax | libxml | rapidxml |
|-----------+--------+---------+--------+-----------+------------+--------+----------|
| user prof | 55 | 608 | 4715 | 17468 | 7350 | 12377 | 2477 |
|-----------+--------+---------+--------+-----------+------------+--------+----------|
| / | < | > | < | > | < | | > |
| input: | PSYC | | JSON | | | XML | |
| parser: | strlen | libpsyc | json-c | json-glib | libxml sax | libxml | rapidxml |
|--------------+--------+---------+--------+-----------+------------+--------+----------|
| user profile | 55 | 608 | 4715 | 16503 | 7350 | 12377 | 2477 |
|--------------+--------+---------+--------+-----------+------------+--------+----------|
| / | < | > | < | > | < | | > |
Pure syntax comparisons above, protocol performance comparisons below:
| input: | PSYC | | JSON | | | XMPP | |
| parser: | strlen | libpsyc | json-c | json-glib | libxml sax | libxml | rapidxml |
|-----------+--------+---------+--------+-----------+------------+--------+----------|
| presence | 30 | 246 | 2463 | 10197 | 4997 | 7557 | 1719 |
| chat msg | 41 | 320 | | | 5997 | 9777 | 1893 |
| activity | 42 | 366 | 4666 | 16846 | 13357 | 28858 | 4419 |
|-----------+--------+---------+--------+-----------+------------+--------+----------|
| / | < | > | < | > | < | | > |
| input: | PSYC | | JSON | | | XMPP | |
| parser: | strlen | libpsyc | json-c | json-glib | libxml sax | libxml | rapidxml |
|-----------------+--------+---------+--------+-----------+------------+--------+----------|
| presence | 30 | 236 | 2463 | 10016 | 4997 | 7557 | 1719 |
| chat msg | 40 | 295 | 2147 | 9526 | 5997 | 9777 | 1893 |
| activity | 42 | 353 | 4666 | 16327 | 13357 | 28858 | 4356 |
| psyc-unfriendly | 70 | 286 | 2892 | 12567 | 5538 | 8659 | 1896 |
| json-unfriendly | 49 | 430 | 2328 | 10006 | 5141 | 7875 | 1751 |
| xml-unfriendly | 37 | 296 | 2156 | 9591 | 5571 | 8769 | 1765 |
|-----------------+--------+---------+--------+-----------+------------+--------+----------|
| / | < | > | < | > | < | | > |
Parsing large amounts of binary data. For JSON & XML base64 encoding was used.
Note that the results below include only the parsing time, base64 decoding was
not performed.
| input: | PSYC | | JSON | | | XML | |
| parser: | strlen | libpsyc | json-c | json-glib | libxml sax | libxml | rapidxml |
|-------------+--------+---------+--------+------------+------------+-----------+----------|
| binary 7K | 92 | 77 | 14459 | 98000 | 11445 | 19299 | 8701 |
| binary 70K | 53 | 77 | 14509 | 1003900 | 96209 | 167738 | 74296 |
| binary 700K | 42 | 77 | 14551 | 10616000 | 842025 | 1909428 | 729419 |
| binary 7M | 258 | 78 | 14555 | 120810000 | 12466610 | 16751363 | 7581169 |
| binary 70M | 304 | 80 | 14534 | 1241000000 | 169622110 | 296017820 | 75308906 |
|-------------+--------+---------+--------+------------+------------+-----------+----------|
| / | < | > | < | > | < | | > |
These tests were performed on a 2.53 GHz Intel(R) Core(TM)2 Duo P9500 CPU.

View file

@ -0,0 +1 @@
"}

View file

@ -0,0 +1 @@
{"data":"

View file

@ -0,0 +1,2 @@
:_foo bar
_data

View file

View file

@ -0,0 +1 @@
</data>

View file

@ -0,0 +1 @@
<data>