[
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.