Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-2267

Property population resolves collection name via SpEL multiple times

    Details

      Description

      Problem: Slow streaming performance (maybe a general problem?!) when non final fields is present in a document entity and @Document annotation with SpEl expression is used.

       

      This problem seems to have been introduced at Spring boot version 2.1.0 as it works in 2.0.x versions

       

      I have reproduced the issue in the attached test project that uses an embedded mongodb.

      Here some of the results, with spring boot 2.1.0:

      // TestEntity includes non final field with a @Document annotation that calls a bean that 
      // generates the collection name
      Took 3218 ms to iterate 100000 items of type TestEntity 
      
      // TestEntity2 includes only final field with a @Document annotation that calls a bean that 
      // generates the collection name
      Took 290 ms to iterate 100000 items of type TestEntity2 
      

      with spring boot version 2.0.9:

      Took 533 ms to iterate 100000 items of type TestEntity
      Took 387 ms to iterate 100000 items of type TestEntity2
      

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cstrobl Christoph Strobl
                Reporter:
                Engström Fredrik
                Last updater:
                Mark Paluch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: