Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2754

SpatialFieldBridge uses inefficient Reflection access

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.8.0.Beta3
    • Component/s: None
    • Labels:
      None

      Description

      The strategy used by SpatialFieldBridge to read the coordinates is very inefficient, as it temptatively attempts a reflection call and then falls back to a second option.
      The approach might be fine, but the attempt is performed for every single read of the Coordinates pair, generating a swallowed exception (with related stacktrace) each time an entity using @Spatial is indexed.

      Stack Trace	Count
      java.lang.Throwable.<init>(String)	17,731
         java.lang.Exception.<init>(String)	17,731
            java.lang.ReflectiveOperationException.<init>(String)	17,731
               java.lang.NoSuchFieldException.<init>(String)	17,731
                  java.lang.Class.getField(String)	17,731
                     org.hibernate.search.spatial.SpatialFieldBridge.getCoordinateFromField(String, Object)	17,731
                        org.hibernate.search.spatial.SpatialFieldBridge.getLatitude(Object)	8,866
                        org.hibernate.search.spatial.SpatialFieldBridge.getLongitude(Object)	8,865
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                yrodiere Yoann Rodière
                Reporter:
                sanne Sanne Grinovero
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: