Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-268

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • M2
    • Java Common
    • None

    Description

      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.

      Attachments

        1. qpid-268.patch
          66 kB
          Robert Godfrey

        Activity

          People

            rgodfrey Robert Godfrey
            rgodfrey Robert Godfrey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: