diff --git a/bench/benchmark.org b/bench/benchmark.org index 70e78df..ba3c7d7 100644 --- a/bench/benchmark.org +++ b/bench/benchmark.org @@ -43,14 +43,25 @@ np ** An average chat message -XML: +XMPP: #+INCLUDE: packets/chat_msg.xml src xml +JSON: + +#+INCLUDE: packets/chat_msg.json src js + PSYC: #+INCLUDE: packets/chat_msg.psyc src psyc +Why PSYC doesn't have an id? Because packet counting from contexts +and circuits is automatic: The packet already has a number just by +being there. + +Also, PSYC by default doesn't mention a "resource" in XMPP terms, +instead it allows for more addressing schemes than just PSYC. + ** A new status updated activity Example taken from http://onesocialweb.org/spec/1.0/osw-activities.html You could call this XML namespace hell: @@ -71,12 +82,16 @@ We'll use the latter here: ** A message with JSON-unfriendly characters #+INCLUDE: packets/json-unfriendly.xml src xml +#+INCLUDE: packets/json-unfriendly.json src js +#+INCLUDE: packets/json-unfriendly.psyc src psyc ** A message with XML-unfriendly characters #+INCLUDE: packets/xml-unfriendly.xml src xml ** A message with PSYC-unfriendly strings #+INCLUDE: packets/psyc-unfriendly.xml src xml +#+INCLUDE: packets/psyc-unfriendly.json src js +#+INCLUDE: packets/psyc-unfriendly.psyc src psyc ** A packet containing a JPEG photograph ... TBD ... diff --git a/bench/packets/chat_msg.json b/bench/packets/chat_msg.json new file mode 100644 index 0000000..6b41aa3 --- /dev/null +++ b/bench/packets/chat_msg.json @@ -0,0 +1,2 @@ +["message",{"from":"juliet@example.com/balcony","to":"romeo@example.net"}, +"Art thou not Romeo, and a Montague?"] diff --git a/bench/packets/chat_msg.psyc b/bench/packets/chat_msg.psyc index b39ad33..51def66 100644 --- a/bench/packets/chat_msg.psyc +++ b/bench/packets/chat_msg.psyc @@ -1,6 +1,6 @@ :_source psyc://example.com/~juliet :_target psyc://example.net/~romeo -_message_private +_message Art thou not Romeo, and a Montague? | diff --git a/bench/packets/json-unfriendly.json b/bench/packets/json-unfriendly.json new file mode 100644 index 0000000..7ce2ba0 --- /dev/null +++ b/bench/packets/json-unfriendly.json @@ -0,0 +1,2 @@ +["message",{"from":"romeo@example.net/orchard","to":"juliet@example.com/balcony"}, +"\"Neither, fair saint, if either thee dislike.\", he said.\nAnd\nthe\nrest\nis\nhistory."] diff --git a/bench/packets/json-unfriendly.psyc b/bench/packets/json-unfriendly.psyc new file mode 100644 index 0000000..7747862 --- /dev/null +++ b/bench/packets/json-unfriendly.psyc @@ -0,0 +1,11 @@ +:_source psyc://example.com/~romeo +:_target psyc://example.net/~juliet + +_message +"Neither, fair saint, if either thee dislike.", he said. +And +the +rest +is +history. +| diff --git a/bench/packets/psyc-unfriendly.json b/bench/packets/psyc-unfriendly.json new file mode 100644 index 0000000..a0eb59c --- /dev/null +++ b/bench/packets/psyc-unfriendly.json @@ -0,0 +1,3 @@ +["message",{"from":"juliet@example.com/balcony',"to":"romeo@example.net", +"subject":"I implore you with a pointless\nnewline in a header variable"}, +"Wherefore art thou, Romeo?\n|\nAnd for practicing purposes we added a PSYC packet delimiter.] diff --git a/bench/packets/psyc-unfriendly.psyc b/bench/packets/psyc-unfriendly.psyc new file mode 100644 index 0000000..514015c --- /dev/null +++ b/bench/packets/psyc-unfriendly.psyc @@ -0,0 +1,10 @@ +:_source psyc://example.com/~juliet +:_target psyc://example.net/~romeo +177 +:_subject 59 I implore you with a pointless +newline in a header variable +_message +Wherefore art thou, Romeo? +| +And for practicing purposes we added a PSYC packet delimiter. +|