Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-143

BitFileBuffered creates unnecessary byte arrays

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.5
    • Component/s: .compression
    • Labels:
      None

      Description

      BitFileBuffered creates a new byte[] every time it reads more from disk. Memory allocations in java are expensive, and further GC overheads are introduced. It would be better to either clear it, or even better let it be overwritten by the inBuffer.read() call. Much unit testing would be required.

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          This has been in use for a while without adverse affects. Committing and resolving.

          Show
          craigm Craig Macdonald added a comment - This has been in use for a while without adverse affects. Committing and resolving.
          Hide
          craigm Craig Macdonald added a comment -

          Initial patch.

          Show
          craigm Craig Macdonald added a comment - Initial patch.

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: