stevedlawrence opened a new pull request #419:
URL: https://github.com/apache/incubator-daffodil/pull/419
- Remove the DIFinalizable trait and setFinal function and replace with
direct modification of isFinal. Scala created some pretty inefficient
byte code for this which actually made a noticeable difference in
performance when removed.
- Add function to DINodes to efficiently return a Maybe of the last
child. This replaces the lastOption and avoids an Option allocation
- Remove the containerNode def and just keep track of the container node
in the InfosetWalker with a new stack. Avoids virtual function calls
and instanceOf/asInstanceOf.
- Skip batches of walk() calls. This avoids the overhead related to step
logic when no progress is being made due to PoU's and allows batching
of steps rather than stepping each time a infoset node is added.
- Replace the various infoset walker objects with functions. Rather than
returning objects in a Maybe and calling a function in those optionst,
just call the functions directly and return a boolean that says
whether a step was taken. Essentially the same logic, but avoids
object creation and virtual functions.
- Avoid accessing the top of the infoset walker stacks multiple times.
Instead, access once and pass down as parameters. These stack accesses
actually showed up quite a bit in profiling
- Remove match/case on types, and instead use functions to imply the
type. Avoids instanceOf/asInstanceOf which have a noticeable
overhead in inner loops
- Add a new setTop function to modify the top of an MStack. Avoids logic
to pop and then push a new value.
- Remove extra logic about saved last child node, this didn't make much
of a difference in when we called set final, and just added extra
overhead
- Remove calls to walk() made when PoU's were resolved. Instead, only
walk() when new elements are added. Elements are added all the time so
these extra calls just added overhead. The new step skipping logic
also helps with this.
DAFFODIL-2396
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]