From 19d9420eaad1c99a4e321218537599cf0adb2c1a Mon Sep 17 00:00:00 2001
From: "psyc://psyced.org/~lynX" <@>
Date: Sun, 15 May 2011 22:59:30 +0200
Subject: [PATCH] funny activity stream encoding for xmpp
---
bench/benchmark.wiki | 132 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 130 insertions(+), 2 deletions(-)
diff --git a/bench/benchmark.wiki b/bench/benchmark.wiki
index 87b5ced..498b76d 100644
--- a/bench/benchmark.wiki
+++ b/bench/benchmark.wiki
@@ -27,7 +27,6 @@ Here's an example from paragraph 4.4.2 of RFC 6121.
to='benvolio@example.net'>
away
-
}}}
And here's the same information in a JSON rendition:
@@ -59,11 +58,132 @@ np
}}}
=== An average chat message ===
-=== A social network activity ===
+
+{{{
+
+ Art thou not Romeo, and a Montague?
+
+}}}
+
+=== A new status updated activity ===
+
+Example taken from http://onesocialweb.org/spec/1.0/osw-activities.html
+You could call this XML namespace hell:
+
+{{{
+
+
+
+ -
+
+ to be or not to be ?
+ http://activitystrea.ms/schema/1.0/post
+
+ http://onesocialweb.org/spec/1.0/object/status
+ to be or not to be ?
+
+
+
+ http://onesocialweb.org/spec/1.0/acl/action/view
+
+
+
+
+
+
+
+
+}}}
+
+http://activitystrea.ms/head/json-activity.html proposes a JSON encoding
+of this. We'll have to add a routing header to it.
+
+{{{
+["activity",{"from":"hamlet@denmark.lit/snsclient"},{"verb":"post",
+"title":"to be or not to be ?","object":{"type":"status",
+"content":"to be or not to be ?","contentType":"text/plain"}]
+}}}
+
+http://about.psyc.eu/Activity suggests a PSYC mapping for activity
+streams. Should a "status post" be considered equivalent to a presence
+description announcement or just a message in the "microblogging" channel?
+We'll use the latter here:
+
+{{{
+:_context psyc://denmark.lit/~hamlet#_follow
+
+:_subject to be or not to be ?
+:_type_content text/plain
+_message
+to be or not to be ?
+|
+}}}
+
=== A message with JSON-unfriendly characters ===
+
+{{{
+
+ "Neither, fair saint, if either thee dislike.", he said.
+And
+the
+rest
+is
+history.
+
+}}}
+
=== A message with XML-unfriendly characters ===
+
+{{{
+
+ Wherefore art thou, Romeo?
+
+ PročeŽ jsi ty, Romeo?
+
+
+}}}
+
+=== A message with PSYC-unfriendly strings ===
+
+{{{
+
+ I implore you with a pointless
+newline in a header variable
+ Wherefore art thou, Romeo?
+|
+And for practicing purposes we added a PSYC packet delimiter.
+
+}}}
+
=== A packet containing a JPEG photograph ===
+... TBD ...
+
=== A random data structure ===
In this test we'll not consider XMPP at all and simply compare the
@@ -107,6 +227,8 @@ _profile_user
== Conclusions ==
+... TBD ...
+
== Criticism ==
Are we comparing apples and oranges? Yes and no, depends on what you
@@ -139,3 +261,9 @@ the performance of a chat client using the two protocols,
for instance by using libpurple with XMPP and PSYC accounts.
To this purpose we first need to integrate libpsyc into libpurple.
+== Futures ==
+
+After a month of development libpsyc is already performing pretty
+well, but we presume various optimizations, like rewriting parts
+in assembler, are possible.
+