Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6043

FireAllRules response time increase on date constraint-intensive rulesets with executable model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.49.0.Final
    • core engine
    • None
    • 2021 Week 10-12 (from Mar 8)
    • Hide

      Run with executable model:

          mvn clean install
          cd benchmark
          ./runJMH.sh
      

      Run without executable model:

          mvn -Denable.executable.model=no clean package
          cd benchmark
          ./runJMH.sh
      
      Show
      Run with executable model: mvn clean install cd benchmark ./runJMH.sh Run without executable model: mvn -Denable.executable.model=no clean package cd benchmark ./runJMH.sh
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

      We notice a significant performance regression on firing rules which make intensive use of constraints on dates with executable model.

      From a quick look at the flame graphs, it looks like plenty of CPU is spent in java/time/LocalDate.parse and java/util/GregorianCalendar.from, when executable model is used.

      The attached benchmark shows a 600%+ increase of response time when running with executable model instead of drl.

      DRL:

          Benchmark                                                                                        (inputFacts)  (kieBaseName)    Mode   Cnt   Score   Error  Units
          DroolsFireJMHBench.testOneFactAgainsAllRules                                    src/main/resources/facts.json    testKieBase  sample  2728  18.340 ▒ 0.240  ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.00    src/main/resources/facts.json    testKieBase  sample        14.598          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.50    src/main/resources/facts.json    testKieBase  sample        17.105          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.90    src/main/resources/facts.json    testKieBase  sample        23.170          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.95    src/main/resources/facts.json    testKieBase  sample        26.116          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.99    src/main/resources/facts.json    testKieBase  sample        32.920          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.999   src/main/resources/facts.json    testKieBase  sample        46.064          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p0.9999  src/main/resources/facts.json    testKieBase  sample        55.443          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules▒p1.00    src/main/resources/facts.json    testKieBase  sample        55.443          ms/op
      

      Executable model:

          Benchmark                                                                                        (inputFacts)  (kieBaseName)    Mode  Cnt    Score   Error  Units
          DroolsFireJMHBench.testOneFactAgainsAllRules                                    src/main/resources/facts.json    testKieBase  sample  363  138.380 ± 4.116  ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.00    src/main/resources/facts.json    testKieBase  sample       116.523          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.50    src/main/resources/facts.json    testKieBase  sample       131.072          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.90    src/main/resources/facts.json    testKieBase  sample       160.956          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.95    src/main/resources/facts.json    testKieBase  sample       173.172          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.99    src/main/resources/facts.json    testKieBase  sample       271.602          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.999   src/main/resources/facts.json    testKieBase  sample       313.000          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p0.9999  src/main/resources/facts.json    testKieBase  sample       313.000          ms/op
          DroolsFireJMHBench.testOneFactAgainsAllRules:testOneFactAgainsAllRules·p1.00    src/main/resources/facts.json    testKieBase  sample       313.000          ms/op
      

        1. fg-Drools_7_49_0_drl.svg
          960 kB
          Matteo Casalino
        2. fg-Drools_7_49_0_exec_model.svg
          926 kB
          Matteo Casalino

            mfusco@redhat.com Mario Fusco
            mcasalino Matteo Casalino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: