You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rh...@apache.org on 2011/03/08 19:47:39 UTC

svn commit: r1079482 - in /qpid/branches/0.10/qpid/python: ./ examples/api/spout qpid/codec010.py qpid/concurrency.py

Author: rhs
Date: Tue Mar  8 18:47:39 2011
New Revision: 1079482

URL: http://svn.apache.org/viewvc?rev=1079482&view=rev
Log:
QPID-3130: applied patch for slow codec

Modified:
    qpid/branches/0.10/qpid/python/   (props changed)
    qpid/branches/0.10/qpid/python/examples/api/spout   (props changed)
    qpid/branches/0.10/qpid/python/qpid/codec010.py
    qpid/branches/0.10/qpid/python/qpid/concurrency.py   (props changed)

Propchange: qpid/branches/0.10/qpid/python/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 18:47:39 2011
@@ -2,4 +2,4 @@
 /qpid/branches/java-network-refactor/qpid/python:805429-825319
 /qpid/branches/qmfv2/qpid/python:902858,902894
 /qpid/branches/qpid-2935/qpid/python:1061302-1072333
-/qpid/trunk/qpid/python:1078075,1078733,1078743
+/qpid/trunk/qpid/python:1078075,1078733,1078743,1079434

Propchange: qpid/branches/0.10/qpid/python/examples/api/spout
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 18:47:39 2011
@@ -1,4 +1,4 @@
 /qpid/branches/qmfv2/qpid/python/examples/api/spout:902858,902894
 /qpid/branches/qpid-2935/qpid/python/examples/api/spout:1061302-1072333
 /qpid/branches/qpid.rnr/python/examples/api/spout:894071-896158
-/qpid/trunk/qpid/python/examples/api/spout:1078075,1078733,1078743
+/qpid/trunk/qpid/python/examples/api/spout:1078075,1078733,1078743,1079434

Modified: qpid/branches/0.10/qpid/python/qpid/codec010.py
URL: http://svn.apache.org/viewvc/qpid/branches/0.10/qpid/python/qpid/codec010.py?rev=1079482&r1=1079481&r2=1079482&view=diff
==============================================================================
--- qpid/branches/0.10/qpid/python/qpid/codec010.py (original)
+++ qpid/branches/0.10/qpid/python/qpid/codec010.py Tue Mar  8 18:47:39 2011
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-import datetime
+import datetime, string
 from packer import Packer
 from datatypes import serial, timestamp, RangedSet, Struct, UUID
 from ops import Compound, PRIMITIVE, COMPOUND
@@ -241,15 +241,20 @@ class Codec(Packer):
       v = sc.read_primitive(type)
       result[k] = v
     return result
+
+  def _write_map_elem(self, k, v):
+    type = self.encoding(v)
+    sc = StringCodec()
+    sc.write_str8(k)
+    sc.write_uint8(type.CODE)
+    sc.write_primitive(type, v)
+    return sc.encoded
+
   def write_map(self, m):
     sc = StringCodec()
     if m is not None:
       sc.write_uint32(len(m))
-      for k, v in m.items():
-        type = self.encoding(v)
-        sc.write_str8(k)
-        sc.write_uint8(type.CODE)
-        sc.write_primitive(type, v)
+      sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), ""))
     self.write_vbin32(sc.encoded)
 
   def read_array(self):

Propchange: qpid/branches/0.10/qpid/python/qpid/concurrency.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 18:47:39 2011
@@ -1,4 +1,4 @@
 /qpid/branches/qmfv2/qpid/python/qpid/concurrency.py:902858,902894
 /qpid/branches/qpid-2935/qpid/python/qpid/concurrency.py:1061302-1072333
 /qpid/branches/qpid.rnr/python/qpid/concurrency.py:894071-896158
-/qpid/trunk/qpid/python/qpid/concurrency.py:1078075,1078733,1078743
+/qpid/trunk/qpid/python/qpid/concurrency.py:1078075,1078733,1078743,1079434



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org