[Performance] Changes to code generated by code generator for performance 
improvements
--------------------------------------------------------------------------------------

                 Key: QPID-268
                 URL: https://issues.apache.org/jira/browse/QPID-268
             Project: Qpid
          Issue Type: Improvement
          Components: Java Common
            Reporter: Rob Godfrey


Testing has shown that we can get not insignificant performance improvements by 
changing the code generated by the code generator.  

Firstly we can reduce the overhead of object creation by removing unnecessary 
string concatenation in using strings for lookups.  That is - no longer use a 
String representation of the protocol version to do lookups.

Secondly we can create AMQMethodBody objects with a constructor which takes in 
the byte buffer, and gets the object to populate itself from this, rather than 
first creating an empty object and then asking it to populate itself.  The 
first course of action seems to allow the run-time compiler to optimize-out 
some aspects of the the object creation.

Thirdly we can change the way the generated classes ask for their packed bit 
arrays to be encoded and decoded.  Instead of creating temporary boolean[] 
objects, we process the packing into byte objects in place.

The changes also allow further performance improvements to be made later by 
changing the way objects are looked up in the registries.  For instance, in the 
MainRegistry the template could now be changed to allow looking up the 
MethodBody objects in a sparse multi-dimensional array, rather than a Long 
indexed HashMap.  This can now be done purely by changing the template and 
without having to change the code generator.

See attached patch file.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to