Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3004

Get rid of the finalizer in EmbedResultSet

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.3.1.4
    • 10.4.1.3
    • JDBC
    • None
    • Performance

    Description

      Finalizers make object allocation and garbage collection more expensive and should be avoided for object types that are frequently allocated. EmbedResultSet has a finalize() method and is frequently allocated for many types of load. The following comment was posted on DERBY-1876:

      By commenting out the finalize() method in EmbedResultSet, the time to run the test on my laptop is reduced from ~3 seconds to ~1.3 seconds (OpenSolaris, Sun Java SE 6). Since the finalizer is a no-op if the activation isn't single-use, I think we should investigate whether there are ways to avoid this cost for ResultSets that don't need the finalizer.

      Attachments

        1. d3004.diff
          3 kB
          Knut Anders Hatlen
        2. d3004.stat
          0.1 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: