Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1301

SimpleTypeInformationMapper.resolveTypeFrom(…) should cache type lookup failures to prevent repeated lookups

    Details

      Description

      This StackOverflow post describes a performance bottle neck in excessive calls to Class.forName(…) coming from SimpleTypeInformationMapper.resolveTypeFrom(…). The method already uses a cache to prevent repeated lookups of successfully loaded classes.

      Failed attempts – that might stem from a refactoring in the codebase so that there's a mismatch between the type captured in the document and the type available in the JVM – lead to the resolution process to kick in for every call to the method which is obviously superfluous as we can assume to lookup to fail all the time if it failed once.

      The Kay generation already caches failed attempts by using Optional.

        Attachments

          Activity

            People

            • Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              olivergierke Oliver Drotbohm
              Last updater:
              Mark Paluch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: