You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Nathan Mittler (JIRA)" <ji...@apache.org> on 2007/03/18 15:01:34 UTC

[jira] Created: (AMQCPP-93) Performance analysis

Performance analysis
--------------------

                 Key: AMQCPP-93
                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
             Project: ActiveMQ C++ Client
          Issue Type: Task
    Affects Versions: 2.0
            Reporter: Nathan Mittler
         Assigned To: Nathan Mittler
             Fix For: 2.0


Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39518 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

Gereld, I think Timothy meant getting rid of the Endian include in DataOutputStream.

Anyway, I would like to know why the patch breaks things on Solaris. Unfortunately, I don't have access to that platform. A comment in the source might have prevented me from being tempted (although I still am).

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Mittler updated AMQCPP-93:
---------------------------------

    Fix Version/s:     (was: 2.0)
                   2.1

moving to 2.1 so we can get 2.0 out the door

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>         Assigned To: Nathan Mittler
>             Fix For: 2.1
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39480 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

I've been spending the last day or so using a profiler against a test harness we have which sends and receives within the same process 2000 BytesMessages of approximately 500k in size with integers, doubles, strings, etc embedded within the body of the message. Normally this task takes 5-7 seconds on a couple of other middeware products we use but with the ActiveMQ C++ interface it was taking 26 seconds or so. Essentially I made two rather small changes which cut the time down to 15 seconds, which is approximately a 30% increase in performance. Both of these changes were done within the DataInputStream.cpp class. First, majority of the unmarshalling code was calling readFully for 1 byte. For the single byte extraction, I changed these readFully operations to inputStream->read() which only return a single byte. There is an incorrectness in the code that assumes that the inputStream->read(buffer, size) operation will return -1 when inputStream is at its end. This is incorrect. As far as I can tell, read(buffer, size) always throws an exception at the end rather than returning -1. The second enhancement is I buffered up 256 characters before appending the string in readString. Appending one character at a time is very inefficient since it constantly needs to determine if the string object needs to grow, realloc, copy the characters, etc.

The readString operation is still a major hitter in my profiling. It is calling inputStream->read() millions of times which is a virtual function. Most strings are tens, hundreds, or thousands of characters in size. Since it is virtual, it cannot be inlined and they are CPU intensive when called repeatively. I'm sure CPU usage could be dropped another 30-50% if we could move the readString operation from the DataInputStream class to each inputStream class. That way the virtual function is called only once for each string unmarshalling and more inlining can happen. I'll leave it up to the experts in this group on how they want to proceed.

Everything else seems fairly efficient, at least in the test case I was dealing with. The only other item that showed up in the radar is the ByteArrayOutputStream::write(unsigned char c) method. Again in this case, it is constantly realloc, copying, etc when the vector needs to resize. There is a setBuffer method in place but I need to evaluate it a little further to see if we can preallocate our own buffer based on the size we already know what we need up front.

Attached is my diffs. Let me know what you think.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39515 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

Without having a lot of time to look at these, here's some comments.

DataOutputStream patch.

The DataOutputStream changes break everything on Solaris, the methods were implemented the way they were for this reason.  I should have removed Endian so people wouldn't be tempted to use it, but forgot. 

DataInputStream Patch

The changes violate the contract of the readXXX methods in they they are supposed to throw an EOFException if the size of the data item being read is not read from the stream, these change cause it to only ever throw IOException which is incorrect.  Admittedly the documentation in the header isn't clear on this, I will fix it when I get some time. 



> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39483 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

Performance differences are attached in spreadsheet above.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39520 ] 

Gerald Kaas edited comment on AMQCPP-93 at 6/25/07 2:47 PM:
------------------------------------------------------------

Timothy, thank you for the response. I understand your design and appreciate it. Unfortunately without some design change performance cannot be improved. We are seeing the unmarshalling code causing 4 times more CPU than our other two middleware products we use. Unfortunately this not only impacts throughput but also causes CPU starvation away from the other threads/processes. According to the profiler everything else looks great, but the unmarshaller has some simple but major CPU problems. I don't know of any other way to improve on it other than use our own marshaller and unmarshaller. This isn't as much as an issue since already have code in place for one of our other middleware products we use. 

Making the changes I suggested will double your performance but it will require some changes so that you can support EOF in the unsigned char read() operator. Either you can change the declaration to bool read(unsigned char& c) and return true/false if it hit an EOF or have the read functions through an EOF themselves. Either way I'm not sure if it pertains to this issue anymore.

I hope my contributions will help if someone wants to take a look at the performance in the future. I hope and wish everyone the best. Thank you for your help.


 was:
Timothy, thank you for the response. I understand your design and appreciate it. Unfortunately without some design change performance cannot be improved. We are seeing the unmarshalling code taking 4 times more CPU than our other two middleware products we use. Unfortunately this not only impacts throughput but also causes CPU starvation away from the other threads/processes. According to the profiler everything else looks great, but the unmarshaller has some simple but major CPU problems. I don't know of any other way to improve on it other than use our own marshaller and unmarshaller. This isn't as much as an issue since already have code in place for one of our other middleware products we use. 

Making the changes I suggested will double your performance but it will require some changes so that you can support EOF in the unsigned char read() operator. Either you can change the declaration to bool read(unsigned char& c) and return true/false if it hit an EOF or have the read functions through an EOF themselves. Either way I'm not sure if it pertains to this issue anymore.

I hope my contributions will help if someone wants to take a look at the performance in the future. I hope and wish everyone the best. Thank you for your help.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish reassigned AMQCPP-93:
----------------------------------

    Assignee: Timothy Bish  (was: Nathan Mittler)

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Timothy Bish
>             Fix For: 2.1
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39520 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

Timothy, thank you for the response. I understand your design and appreciate it. Unfortunately without some design change performance cannot be improved. We are seeing the unmarshalling code taking 4 times more CPU than our other two middleware products we use. Unfortunately this not only impacts throughput but also causes CPU starvation away from the other threads/processes. According to the profiler everything else looks great, but the unmarshaller has some simple but major CPU problems. I don't know of any other way to improve on it other than use our own marshaller and unmarshaller. This isn't as much as an issue since already have code in place for one of our other middleware products we use. 

Making the changes I suggested will double your performance but it will require some changes so that you can support EOF in the unsigned char read() operator. Either you can change the declaration to bool read(unsigned char& c) and return true/false if it hit an EOF or have the read functions through an EOF themselves. Either way I'm not sure if it pertains to this issue anymore.

I hope my contributions will help if someone wants to take a look at the performance in the future. I hope and wish everyone the best. Thank you for your help.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerald Kaas updated AMQCPP-93:
------------------------------

    Attachment: DataInputStream.patch

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39483 ] 

Gerald Kaas edited comment on AMQCPP-93 at 6/22/07 12:40 PM:
-------------------------------------------------------------

Performance differences are attached in spreadsheet above. It is based on sending and receiving 50 messages instead of 2000 since profiled code executes much slower.


 was:
Performance differences are attached in spreadsheet above.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-93:
-----------------------------------

    Attachment: amqcpp-perf1v2.patch

Updated version of the patch as requested.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-93:
-----------------------------------

    Attachment: bench2.cpp

Another benchmark.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39539 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

If I understand correctly, this was with Openwire? Did you perhaps try the test with Stomp? We're currently using Stomp due to Openwire's performance issues.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39446 ] 

Gerald Kaas edited comment on AMQCPP-93 at 6/18/07 2:54 PM:
------------------------------------------------------------

I also have been doing some profiling of the activemq-cpp-2.0.1 tag and I am finding that the DataInputStream class is fairly inefficient and can be greatly improved upon. Most of the inefficiencies are in the readString and readFully methods. readString appends to the string object one character at a time, which is very inefficient. Also, most methods are calling readFully for one byte. It would be better to create a different method to read one byte which would then call the read method the returns the unsigned char.

I can probably work on a patch but I have never work with an open source project before. How do I proceed?


 was:
I also have been doing some profiling of the activemq-cpp-2.0.1 tag and I am finding that the DataInputStream class is fairly inefficient and can be greatly improved upon. Most of the inefficiencies are in the readString and readFully methods. readString appends to the string object one character at a time, which is very inefficient. Also, most methods are calling readFully for one byte. It would be better to create a different method to read one byte which would then call the read method the returns the unsigned char.

I can probably work on a patch but I have never work with an open source project before. How do I proceed?

Also, attached are my profile output.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39516 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

Timothy, I have carefully looked at BufferedInputStream and ByteArrayInputStream read(unsigned char*, size_t ) and they have NO LOGIC to return -1. These methods currently always throw IOException which means that the contract is never followed in the first place. Since -1 is never returned and IOException is always thrown, DataInputStream::readFully can never throw a EOFException. The unit tests cases don't test these conditions. I have a small test program which can be walked through with the debugger if you wish.

Where should we go from here? According to the current logic, unsigned char read() and size_t read(unsigned char*, size_t) act exactly the same for reading a single byte. We will always hit a major performance problem until we can stop calling a virtual function for each character in a string. The other unmarshalling read statements can probably be improved upon by calling readFully for more than 1 character, but the only way I can think of that we can improve string is to add a readString pure virtual function in the InputStream class which then all derived classes need to implement.

Please research and comment.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39242 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

I've done some profiling of a benchmark that simulates part of our application using Intel VTune (great tool, and free for non-commerial use on Linux).

We're mostly doing quite a few writeLongs and writeInts on a BytesMessage. The data ends up in the 1 KB to 2 KB range. Then we send the messages to a topic. For the benchmark I profiled, we didn't have any consumers, so the broker probably just discards the message. Throughout the test runs, the broker was never very busy.

When using Stomp, the top functions were:

ByteArrayOutputStream::write(unsigned char) 26.23%
DataOutputStream::write(unsigned char) 20.32%
[our function that does some mangling of the data before it is written to the message] 11.93%
[everything else] 41.61%

With Openwire the picture was more or less the same:

ByteArrayOutputStream::write(unsigned char) 22.27%
DataOutputStream::write(unsigned char) 17.33%
ByteArrayOutputStream::write(unsigned char*, size_t) 15.65%
[our function that does some mangling of the data before it is written to the message] 9.82%
[everything else] 34.93%

We see that Stomp is quite a bit faster than Openwire. It's interesting to note that Openwire calls two different write functions on ByteArrayOutputStream and that both eat up quite a substantial amount of the time (37.92% for both in Openwire vs 26.23% for the single function in Stomp).

A few times we some strange long pauses (up to 500 ms) between sends. This might be due to some Delayed ACK/Nagle's algorithm issue, as is described here:

http://www.stuartcheshire.org/papers/NagleDelayedAck/

In conclusion, it looks ByteArrayOutputStream and DataOutputStream might be good candidates to attempt to optimize (at least for this application).

I'm working on removing our application-specific code from this benchmark. I'll attach the code here when I'm done.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerald Kaas updated AMQCPP-93:
------------------------------

    Attachment: patch Results.xls

Performance differences with DataInputStream.cpp patch.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39487 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

I've looked a bit more at the streams from DataOutputStream on down and made a few changes to writeInt and writeLong. On a modified version of bench1.cpp that creates a new message for every send, my modifications makes it about 33% faster when using Stomp. I have some more ideas for DataInputStream too.

Once I get all the unit tests passing again, I'll submit a patch.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39597 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

I've submitted a new version of the ByteArrayInputStream with the read method performing consistently on both Linux and Windows, and its even faster than it was before on windows using this method, and way faster on Linux.  For some reason the insert method on Linux for vector is very slow.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39519 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

If the code in those classes isn't adhering to their explicit contract, than its a bug, not a feature that we can exploit.  We should create an issue, call out the offending classes, and add test cases that demonstrate the issue so that we can eventually add them into our unit tests to prove we are meeting our contracts.  

We cannot add a readString to InputStream as the Input and OuputStream interfaces define a low level interface that is not to be aware of anything other than primitive types, classes like SocketInputStream, ByteArrayInputStream etc don't know and shouldn't know how to read those types of objects, that's not their purpose.  As we move up to higher levels of abstraction like DataInputStream we add on the knowledge of such things as what a UTF String verses a ASCII string look like in the stream, at even higher levels you could create something to read ClassX and ClassY, but you wouldn't want to add that back into the InputStream interface.  

If we can increase the performance of readString in DataInputStream that's great but we can't do it by violating the contract of the interfaces that are implemented.  We are striving for generic reusable code that can run across many platforms and provide a flexible interface for its users, to that end you sometimes have to sacrifice a little performance.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39446 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

I also have been doing some profiling of the activemq-cpp-2.0.1 tag and I am finding that the DataInputStream class is fairly inefficient and can be greatly improved upon. Most of the inefficiencies are in the readString and readFully methods. readString appends to the string object one character at a time, which is very inefficient. Also, most methods are calling readFully for one byte. It would be better to create a different method to read one byte which would then call the read method the returns the unsigned char.

I can probably work on a patch but I have never work with an open source project before. How do I proceed?

Also, attached are my profile output.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39579 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

Timothy, looks like your DataOutputStream changes achieve the same performance improvements as my attempt. Nice one!

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39258 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

Both are order N, but using insert is cleaner and has possibly less jump calls in the assembly, so looks good to me.

I think you need to regen the patch though against the latest SVN as the Random patch changed the VS project files and it doesn't want to apply to them now.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39537 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

I'm not sure if anyone is interested, but I wanted to post the results of the internal test. Originally our small test program marshalled, sent, received, and unmarshalled 2000 messages. Each message was approx 100k in size composed of shorts, integers, doubles, and strings.

Using the ActiveMQ marshalling code we were able to run this program in 27-28 seconds. Using our own internal marshalling code that was very similar and generated exactly the same message body we were able to run this program in 7-8 seconds. There were no other changes to the ActiveMQ code other than using a different marshalling harness.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39250 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

If you look at the code for these two classes though, there really isn't much there, I've gone through it and made a couple small tweaks that might help, but not very much though.

I figured that these would show up as heavy hitters, but since they are really at the heart of the library its not surprising.  They are called a lot.  If you look through and see any tweaks, to those we can add them, I'd look at the next level up though as the code above those layers is where I bet a lot more of the inefficiencies are going to be.  I know for sure where some of the Openwire slowness is coming from but haven't had time to play with it, requires changing the scripts and connector code.  

Not to brag :) , but our stomp implementation is really sweet there isn't much at all that has to happen to get a message out on the wire as its stored pretty much in wire format in the base frame class always.  There's a whole lot more that has to happen when an Openwire message goes out, that code is definitely still young and will need to lot of fine tuning.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Gerald Kaas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39517 ] 

Gerald Kaas commented on AMQCPP-93:
-----------------------------------

I'm not sure why you want to get rid of the Endian class. The WORDS_BIGENDIAN macro can be replaced with...

  const int t1 = 1;
  const char* const t2 = (const char* const) &a;
  if (t1 != *t2)
  {
  ....

All modern compilers will optimize this to choose either one branch or the other. But, it probably would make sense to move the code from Endian.cpp to Endian.h. That way the compiler can inline the code at compile time rather than link time.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39447 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

See the Creating Patches section on this page:
http://activemq.apache.org/contributing.html


> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-93:
-----------------------------------

    Attachment: bench1.cpp

Send benchmark. Needs Random from AMQCPP-125.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39485 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

Your patch doesn't break any unit or integration tests, so it looks good.

GCC 4.1.1 emits the following warning though:

activemq/io/DataInputStream.cpp: In member function 'virtual std::string activemq::io::DataInputStream::readString()':
activemq/io/DataInputStream.cpp:236: warning: comparison between signed and unsigned integer expressions

I'm not certain, but I think the right way to fix this is to cast sizeof(tmpStr) to std::ptrdiff_t before comparing it p - tmpStr.


> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-93:
-----------------------------------

    Attachment: DataOutputStreamv0.patch

Here's a patch for DataOutputStream that makes it significantly faster on bench2 (to be attached) when using Stomp. On my dual core Windows XP machine with ActiveMQ 4.1.1 and a Release build, it looks like it's at least 20-30% faster.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39484 ] 

Albert Strasheim commented on AMQCPP-93:
----------------------------------------

Gerald, very nice! Would it be possible for you to decouple your benchmark from any "private" code and attach it here?

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, DataInputStream.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39260 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

Patch Applied

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQCPP-93.
--------------------------------

    Resolution: Fixed

I'm resolving this issue as of now, I'd like any new Performance related issues to get created as an issue against a specific task or class.  All of the performance changes made for this issue have made it into the 2.1 tag and will be part of the upcoming release.  

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Timothy Bish
>             Fix For: 2.1
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish updated AMQCPP-93:
-------------------------------

    Fix Version/s:     (was: 2.1)
                   2.2

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39580 ] 

Timothy Bish commented on AMQCPP-93:
------------------------------------

Thanks.

I'm investigating something that I noticed while tuning this class.  The write method in the ByteArrayOutputStream was changed to use the vector insert method, but when testing with the code in the decaf folder that doesn't have this change I noticed that the code runs noticeably faster (at least twice as fast) using the for loop / push_back code.  This is on my Linux machine, not sure yet if the same is true on Windows.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish updated AMQCPP-93:
-------------------------------

    Fix Version/s:     (was: 2.2)
                   2.1

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Timothy Bish
>             Fix For: 2.1
>
>         Attachments: amqcpp-perf1.patch, amqcpp-perf1v2.patch, bench1.cpp, bench2.cpp, DataInputStream.patch, DataOutputStreamv0.patch, patch Results.xls
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-93) Performance analysis

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-93:
-----------------------------------

    Attachment: amqcpp-perf1.patch

I found a few places where push_back is called in a loop. Instead, one can use insert. It looks like this helps a bit for Openwire (judging from the bench1.cpp), but the times have rather large variance, so it's hard to certain.

> Performance analysis
> --------------------
>
>                 Key: AMQCPP-93
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-93
>             Project: ActiveMQ C++ Client
>          Issue Type: Task
>    Affects Versions: 2.0
>            Reporter: Nathan Mittler
>            Assignee: Nathan Mittler
>             Fix For: 2.2
>
>         Attachments: amqcpp-perf1.patch, bench1.cpp
>
>
> Do a performance analysis on openwire vs stomp.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.