Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F3C77DE5 for ; Sat, 16 Jul 2011 11:55:30 +0000 (UTC) Received: (qmail 28405 invoked by uid 500); 16 Jul 2011 11:55:29 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 26838 invoked by uid 500); 16 Jul 2011 11:55:27 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 25494 invoked by uid 99); 16 Jul 2011 11:55:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 11:55:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jul 2011 11:55:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5F523828B0 for ; Sat, 16 Jul 2011 11:55:00 +0000 (UTC) Date: Sat, 16 Jul 2011 11:55:00 +0000 (UTC) From: "Sergio Bossa (JIRA)" To: issues@commons.apache.org Message-ID: <611092394.19843.1310817300387.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1669691931.19839.1310817300186.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (IO-278) Improve Tailer performance with buffered reads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IO-278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sergio Bossa updated IO-278: ---------------------------- Attachment: TailerTest.diff Tailer.diff > Improve Tailer performance with buffered reads > ---------------------------------------------- > > Key: IO-278 > URL: https://issues.apache.org/jira/browse/IO-278 > Project: Commons IO > Issue Type: Improvement > Affects Versions: 2.0.1 > Reporter: Sergio Bossa > Attachments: Tailer.diff, TailerTest.diff > > > I noticed Tailer read performances are pretty poor when dealing with large, frequently written, log files, and this is due to the use of RandomAccessFile which does unbuffered reads, hence causing lots of disk I/O. > So I improved the Tailer implementation by introducing buffered reads: it works by loading large (configurable) file chunks in memory, and reading lines from there; this enhances performances in my tests from 10x to 30x depending on the file size. > I also added two test cases: one to simulate reading of a large file (you can use it to compare performances), the other to verify correct handling on buffer breaks; obviously, all tests pass. > I'm attaching the diff files, let me know if it's okay for you guys! -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira