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

Drools 1500x slower than IncrementalScoreCalculator

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Critical
    • None
    • 7.19.0.Final
    • optaplanner-examples
    • None
    • NEW
    • NEW

    Description

      After being surprised that my own project was working slow, I did some performance test with Optaplanner on the projectJobScheduling example.

      I was really surprised to discover that solving a problem with the same conditions, except using Drools rules instead of an IncrementalScoreCalculator would reduce the calculation by a factor of 1500 !

      I made the test again, but with the an example test set provided in the standard example, i.e.projectJobScheduling, with "A-10" test set.

      Here are the results after 60 seconds :

      incrementalScoreCalculatorClass With <!-<moveThreadCount>AUTO</moveThreadCount>-> :
      17:09:12.577 [l-2-thread-1] INFO Local Search phase (1) ended: time spent (60006), best score ([0]hard/[-3261/-612]soft), score calculation speed (94045/sec), step total (125140).
      17:09:12.577 [l-2-thread-1] INFO Solving ended: time spent (60006), best score ([0]hard/[-3261/-612]soft), score calculation speed (97769/sec), phase total (2), environment mode (REPRODUCIBLE).

      incrementalScoreCalculatorClass With <moveThreadCount>AUTO</moveThreadCount> :
      17:03:52.604 [l-2-thread-1] INFO Local Search phase (1) ended: time spent (60015), best score ([0]hard/[-3392/-663]soft), score calculation speed (112827/sec), step total (130255).
      17:03:52.604 [l-2-thread-1] INFO Solving ended: time spent (60015), best score ([0]hard/[-3392/-663]soft), score calculation speed (116470/sec), phase total (2), environment mode (REPRODUCIBLE).

      scoreDrl with <moveThreadCount>AUTO</moveThreadCount>:
      17:07:02.899 [l-3-thread-1] INFO Construction Heuristic phase (0) ended: time spent (60016), best score (-444init/[-97]hard/[127/-87]soft), score calculation speed (1944/sec), step total (78).
      17:07:02.905 [l-3-thread-1] INFO Solving ended: time spent (60022), best score (-444init/[-97]hard/[127/-87]soft), score calculation speed (1942/sec), phase total (2), environment mode (REPRODUCIBLE).

      I understood that Drools rules was the "recommended" choice, but now I doubt if it is worth using it with such bad performance.

      Is it something that you are aware of ? Is there a workaround.

      Many thanks again for such a great tool ! Didier

      Attachments

        Activity

          People

            Unassigned Unassigned
            dstadel Didier Stadelmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: