qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject Low hanging fruit: Performance patch
Date Mon, 04 Dec 2006 16:17:15 GMT
This patch improves the performance of my test by about 20%

It removes a lot of unnecessary string creation, as ...::check(...) is 
called for every CHECK_APR_SUCCESS(), and they are very frequent.

[At this point it seems I have come to the end of the "low hanging 
fruit" though. I'll have to do some real work to get performance wins]

Index: cpp/lib/common/sys/apr/APRBase.h
--- cpp/lib/common/sys/apr/APRBase.h    (revision 482153)
+++ cpp/lib/common/sys/apr/APRBase.h    (working copy)
@@ -52,7 +52,7 @@
     //this is also a convenient place for a helper function for error 
-    void check(apr_status_t status, const std::string& file, const int 
+    void check(apr_status_t status, const char* file, const int line);
     std::string get_desc(apr_status_t status);
 #define CHECK_APR_SUCCESS(A) qpid::sys::check(A, __FILE__, __LINE__);
Index: cpp/lib/common/sys/apr/APRBase.cpp
--- cpp/lib/common/sys/apr/APRBase.cpp  (revision 482153)
+++ cpp/lib/common/sys/apr/APRBase.cpp  (working copy)
@@ -82,7 +82,7 @@
-void qpid::sys::check(apr_status_t status, const std::string& file, 
const int line){
+void qpid::sys::check(apr_status_t status, const char* file, const int 
     if (status != APR_SUCCESS){
         const int size = 50;
         char tmp[size];

View raw message