Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2586

Possible performance improvement: do not create undo moves of undo moves

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Optional Optional
    • 8.16.0.Final
    • None
    • optaplanner-core
    • None
    • 2021 Week 49-51 (from Dec 6th)
    • 3
    • NEW
    • NEW

      Phases do moves by calling Move.doMove(), which always creates and returns an undo move. This is also true for undo moves – as part of doing an undo move, a secondary undo move (undo of undo) instance is created. But that is (most likely) completely useless.

      Slow stepping algorithms that evaluate thousands and thousands of moves before making a step might benefit from not creating those useless undo-of-undo-move instances.

      • Measure the performance gain. Start with an example that has a high score calculation speed, where the potential performance gain is greatest. Based on the result there either continue or kill this idea.
      • Be careful not to break the contract of Move.doMove() when optimizing this. If the contract is significantly broken, the change must go into the next major version.

            lpetrovi@redhat.com Lukáš Petrovický (Inactive)
            jlocker Jiří Locker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: