Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF108E18C for ; Thu, 14 Feb 2013 10:28:39 +0000 (UTC) Received: (qmail 8846 invoked by uid 500); 14 Feb 2013 10:28:39 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 8744 invoked by uid 500); 14 Feb 2013 10:28:39 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 8732 invoked by uid 99); 14 Feb 2013 10:28:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2013 10:28:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2013 10:28:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EE1E923888D2; Thu, 14 Feb 2013 10:28:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1446103 - /subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c Date: Thu, 14 Feb 2013 10:28:16 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130214102816.EE1E923888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stefan2 Date: Thu Feb 14 10:28:16 2013 New Revision: 1446103 URL: http://svn.apache.org/r1446103 Log: On the fsfs-format7 branch: Minimize OS interaction and eliminate double buffering in stringbuf_from_aprfile() in case the file size is known. I.e. don't attempt to read beyond EOF just to detect EOF etc. * subversion/libsvn_subr/io.c (stringbuf_from_aprfile): use a single read request if filesize is known Modified: subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c Modified: subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c?rev=1446103&r1=1446102&r2=1446103&view=diff ============================================================================== --- subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c (original) +++ subversion/branches/fsfs-format7/subversion/libsvn_subr/io.c Thu Feb 14 10:28:16 2013 @@ -2187,7 +2187,19 @@ stringbuf_from_aprfile(svn_stringbuf_t * { apr_finfo_t finfo; if (! (status = apr_stat(&finfo, filename, APR_FINFO_MIN, pool))) - res_initial_len = (apr_size_t)finfo.size; + { + /* we've got the file length. Now, read it in one go. */ + svn_boolean_t eof; + res_initial_len = (apr_size_t)finfo.size; + res = svn_stringbuf_create_ensure(res_initial_len, pool); + SVN_ERR(svn_io_file_read_full2(file, res->data, + res_initial_len, &res->len, + &eof, pool)); + res->data[res->len] = 0; + + *result = res; + return SVN_NO_ERROR; + } } }