Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12508

GridCacheProcessor#cacheDescriptor(int) has O(N) complexity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.11
    • cache

    Description

      See the method code:

          @Nullable public DynamicCacheDescriptor cacheDescriptor(int cacheId) {
              for (DynamicCacheDescriptor cacheDesc : cacheDescriptors().values()) {
                  CacheConfiguration ccfg = cacheDesc.cacheConfiguration();
      
                  assert ccfg != null : cacheDesc;
      
                  if (CU.cacheId(ccfg.getName()) == cacheId)
                      return cacheDesc;
              }
      
              return null;
          }
      

      This method is invoked in several hot paths which causes significant performance regression when the number of caches is large, for example, logical recovery and security check for indexing.

      The method should be improved to use a hash map or similar data structure to get a better complexity

      Attachments

        Activity

          People

            atri Atri Sharma
            ivan.glukos Ivan Rakov
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 5h
                5h