Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6F2310B9F for ; Thu, 27 Feb 2014 04:03:26 +0000 (UTC) Received: (qmail 5136 invoked by uid 500); 27 Feb 2014 04:03:25 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 4892 invoked by uid 500); 27 Feb 2014 04:03:23 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 4405 invoked by uid 99); 27 Feb 2014 04:03:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Feb 2014 04:03:20 +0000 Date: Thu, 27 Feb 2014 04:03:20 +0000 (UTC) From: "Amit Jain (JIRA)" To: dev@jackrabbit.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (JCR-3735) Efficient copying of binaries in Jackrabbit DataStores 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/JCR-3735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13914029#comment-13914029 ] Amit Jain commented on JCR-3735: -------------------------------- >> Do you have numbers to back that statement? A quick benchmark on my laptop (Windows 7, Java 7, 64 bit, SSD) shows FileChannel.transferTo() to actually be an order of magnitude slower than a simple buffered copy from one file to another. You are right on my windows laptop (Windows 7, Java 7, 64 bit SSD) copying an 800MB file is 3 times slower using the FileChannel.transferTo(). But on a linux system, turns out that FileChannel.transferTo() is about 20% faster, though it is not an orders of magnitude faster. So, what you suggest as the next step? > Efficient copying of binaries in Jackrabbit DataStores > ------------------------------------------------------ > > Key: JCR-3735 > URL: https://issues.apache.org/jira/browse/JCR-3735 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-core > Affects Versions: 2.7.4 > Reporter: Amit Jain > > In the DataStore implementations an additional temporary file is created for every binary uploaded. This step is an additional overhead when the upload process itself creates a temporary file. > So, the solution proposed is to check if the input stream passed is a FileInputStream and then use the FileChannel object associated with the input stream to copy the file. -- This message was sent by Atlassian JIRA (v6.1.5#6160)