Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-679

reduce the time to find dependents

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 6.0.0
    • None
    • None
    • Security Level: Jimmy

      Steps to reproduce: case1

      1. import https://docs.google.com/spreadsheets/d/1qkbOKoOoFVA22YQxB-8RgjopDPkyGOl2/edit?usp=share_link&ouid=114351817352708928223&rtpof=true&sd=true
      2. click clear button

      Current Result

      it takes around 1.8s

      Expected result

      less time

      Steps to reproduce: case2

      1. click fill button

      Debug Info

      • I found multiple cells have the same dependents, but when clearing each cell, keikai has to re-search the cell's dependent again, cannot reuse the previous dependent search results.

      Workaround

      use an execution scope cache

      DependencyTableEx.java
      use an execution scope cache Map<precedent, Set<dependent>>.

      • During one execution, multiple cells might collect the same dependents, the cache can save time to locate the same dependents in one execution among multiple cells.
      • But to avoid DependencyTable from depending on Execution directly, it's better to inject the cache from outside.
      • it clears the cache when there is any change

      inject the cache

      set an execution scope cache Map from the caller
      see https://github.com/zkoss/keikaicml/compare/master...keikai-679

        1. DependencyTableEx.java
          17 kB
          hawk
        2. keikai-679.zul
          0.5 kB
          hawk
        3. Keikai679Composer.java
          0.9 kB
          hawk

            jamson jamson
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: