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-qpid | Assignee: | Rafael H. Schloming <rafaels> |
| Status: | CLOSED ERRATA | QA Contact: | Petra Svobodová <psvobodo> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 1.3 | CC: | freznice, gsim, iboverma, jross, jsarenik, mnewsome, tross |
| Target Milestone: | 2.0 | Keywords: | 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: | |||
Created attachment 481589 [details]
python program that acts as requestor as well as responder
Created attachment 481591 [details]
statistics before the patch
Created attachment 481592 [details]
statistics after the patch
Created attachment 481593 [details]
script to invoke the test program in requestor mode multiple times
There's a similar problem with map decode as well. I can't see any simple way to fix that though. 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 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 |
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.