Commons IO
  1. Commons IO
  2. IO-332

Improve tailer's reading performance

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None

      Description

      Now, Tailer triggers a lot of calls to the underlying runtime system, that is, RandomAccessFile.read(), a native method that returns the next byte of the file. This approach is too slow to meet our need. The performance can be improved by using a large buffer, that is using RandomAccessFile.read(byte[]). Then Tailer only rarely accesses the underlying system.

      1. IO-332-1.diff
        5 kB
        Liyin Liang

        Issue Links

          Activity

          Hide
          Gary Gregory added a comment -

          Patch applied with tweaks. Thank you!

          Show
          Gary Gregory added a comment - Patch applied with tweaks. Thank you!
          Hide
          Liyin Liang added a comment -

          Attach a diff file. This diff re-writes the Tailer.readLines() method. With this diff, the reading performance can improve 100X.

          Show
          Liyin Liang added a comment - Attach a diff file. This diff re-writes the Tailer.readLines() method. With this diff, the reading performance can improve 100X.

            People

            • Assignee:
              Unassigned
              Reporter:
              Liyin Liang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development