Current implementation of boolean org.springframework.data.jpa.provider.JpaClassUtils.isOfType(Object source, String typeName, ClassLoader classLoader) is slow because it's written around exception handling. Making an instance of an exception in java is quite expensive, especially before JVM optimisations kick in.
Example of a stack trace:
Milan Mimica opened DATAJPA-941 and commented
Current implementation of
boolean org.springframework.data.jpa.provider.JpaClassUtils.isOfType(Object source, String typeName, ClassLoader classLoader)
is slow because it's written around exception handling. Making an instance of an exception in java is quite expensive, especially before JVM optimisations kick in.Example of a stack trace:
The fix to simply replace it with
boolean java.lang.Class.isInstance(Object obj)
Referenced from: pull request #177
Backported to: 1.10.3 (Hopper SR3), 1.9.5 (Gosling SR5)
The text was updated successfully, but these errors were encountered: