Uploaded image for project: 'Hibernate ORM'
  1. HHH-9294

Reduce throw of NumberFormatException in BaseQueryImpl

    Details

    • Last commented by a user?:
      true
    • Sprint:

      Description

      There is a performance penalty with instantiating a new exception, when filling the stack trace. By running a benchmark we found that there a lot of java.lang.NumberFormatException being thrown and swallowed in hibernate. These were tracked down to org.hibernate.jpa.spi.BaseQueryImpl.toNumberOrNull(String parameterName)

      In this particular case there are two things that can be done to reduce the number of exceptions:
      1) Move the place where toNumberOrNull() is called in findParameterRegistration() so that it only gets called when needed.
      2) Do a check if the chars are digits before attempting the conversion to int

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: