Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 681166

Summary: Improve performance of map encoding into amqp in python qpid client
Product: Red Hat Enterprise MRG Reporter: Siddhesh Poyarekar <spoyarek>
Component: python-qpidAssignee: Rafael H. Schloming <rafaels>
Status: CLOSED ERRATA QA Contact: Petra Svobodová <psvobodo>
Severity: medium Docs Contact:
Priority: high    
Version: 1.3CC: freznice, gsim, iboverma, jross, jsarenik, mnewsome, tross
Target Milestone: 2.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python-qpid-0.9.1079482 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-23 15:46:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to speed up map encoding
none
python program that acts as requestor as well as responder
none
statistics before the patch
none
statistics after the patch
none
script to invoke the test program in requestor mode multiple times none

Description Siddhesh Poyarekar 2011-03-01 11:10:59 UTC
Created attachment 481587 [details]
patch to speed up map encoding

Description of problem:
The current implementation of map encoding into amqp in python is very slow due to the fact that the dictionary is traversed in a simple for loop. Attached patch replaces the for loop with the map function to get significant performance improvement.

Attached test program as well as statistics with and without the patch.

Version-Release number of selected component (if applicable):
python-qpid-0.7.946106-14.el5

How reproducible:
Always

Steps to Reproduce:
1. Run the responder:

./qpid-map-test responder

2. Run the script which makes multiple requests:

./qpid-requestor

3. Wait for requestor to finish
  
Actual results:

The responder will log message size and time taken in milliseconds to send the message.

Comment 1 Siddhesh Poyarekar 2011-03-01 11:14:23 UTC
Created attachment 481589 [details]
python program that acts as requestor as well as responder

Comment 2 Siddhesh Poyarekar 2011-03-01 11:16:05 UTC
Created attachment 481591 [details]
statistics before the patch

Comment 3 Siddhesh Poyarekar 2011-03-01 11:16:36 UTC
Created attachment 481592 [details]
statistics after the patch

Comment 4 Siddhesh Poyarekar 2011-03-01 11:17:22 UTC
Created attachment 481593 [details]
script to invoke the test program in requestor mode multiple times

Comment 6 Siddhesh Poyarekar 2011-03-01 16:01:44 UTC
There's a similar problem with map decode as well. I can't see any simple way to fix that though.

Comment 8 Petra Svobodová 2011-05-19 13:45:00 UTC
The map encoding is faster in the new version, which proves the performance improvement. 

Comparision of results - time of 5000 (before modification) / time of 5000 (after modification):
- in attached files about 6.6
- in my testing machines about 4

Verified on RHEL 5.6 / 6.1rc i[36]86 / x86_64 and packages: 
[root@dhcp-37-202 bug681166]# rpm -qa | grep qpid
qpid-cpp-client-0.10-7.el5
qpid-cpp-client-devel-0.10-7.el5
qpid-cpp-server-store-0.10-7.el5
qpid-java-client-0.10-6.el5
python-qpid-qmf-0.10-8.el5
qpid-qmf-0.10-8.el5
qpid-cpp-client-ssl-0.10-7.el5
qpid-cpp-server-cluster-0.10-7.el5
qpid-java-common-0.10-6.el5
qpid-java-example-0.10-6.el5
qpid-qmf-devel-0.10-8.el5
qpid-tools-0.10-5.el5
qpid-cpp-server-0.10-7.el5
qpid-cpp-server-ssl-0.10-7.el5
qpid-cpp-server-xml-0.10-7.el5
python-qpid-0.10-1.el5
qpid-cpp-server-devel-0.10-7.el5
qpid-cpp-client-devel-docs-0.10-7.el5

--> VERIFIED

Comment 9 errata-xmlrpc 2011-06-23 15:46:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0890.html