Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1417

Performance: Eliminate object copying in parser

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.0.0
    • 1.1.0
    • Back End
    • None

      There are a few deprecation warnings in the code currently which draw attention to a problem with the parser.

      Currently, the mark/reset/discard methods of DataInputStream and PState make copies of objects, and assign objects by value (that is assign one data member after another until the whole object has been assigned).

      These objects are heap allocated, and hence will impact the overhead of garbage collection.

      At minimum an OnStack should be used so these objects are taken from a thread-local pool as needed. Alternatively, and perhaps preferably, these objects should be replaced by mutable stacks that are pushed/popped to save/restore the values of the various "slots" of the state.

      It is worth investigating exactly what all actually needs to be saved/restored, as it may be far less than everything that is being saved/restored now. For example in PState there is a sub-object called MPState that is not, I believe, being copied even though it does contain some amount of mutable state.

              jchab Jessie Chab
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: