Uploaded image for project: 'core.cache'
  1. CCACHE-27

Missing LU and LRU is linear complexity - performance

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Labels:
    • Environment:

      Mac Oracle JDK, Linux OpenJDK

    • Patch:
      Code

      Description

      Profiling some code with YourKit showed a hotspot in cache statistics on (miss) for LU and LRU caches.

      Basically two issues: (count (keys

      {....}

      )) is a count of a seq, not efficient. Replaced with a count of the map.

      Secondly, (apply f anything) is slow. Profiler showed that the (apply min-key) was really slow. This is mitigated by using a c.d.priority-map instead. On a priority-map, (ffirst {}) or (first (peek {}).

      Also inverted the logic for threshold comparison. Since there is a (build-leastness-queue) that populates statistics, should caches should favor codepaths for the state of being full all the time?

        Attachments

          Activity

            People

            • Assignee:
              fogus Fogus
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: