Return-Path: X-Original-To: apmail-crunch-dev-archive@www.apache.org Delivered-To: apmail-crunch-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 03690106C6 for ; Sun, 16 Feb 2014 18:02:32 +0000 (UTC) Received: (qmail 74393 invoked by uid 500); 16 Feb 2014 18:02:25 -0000 Delivered-To: apmail-crunch-dev-archive@crunch.apache.org Received: (qmail 74331 invoked by uid 500); 16 Feb 2014 18:02:25 -0000 Mailing-List: contact dev-help@crunch.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@crunch.apache.org Delivered-To: mailing list dev@crunch.apache.org Received: (qmail 74172 invoked by uid 500); 16 Feb 2014 18:02:22 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 74055 invoked by uid 99); 16 Feb 2014 18:02:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Feb 2014 18:02:20 +0000 Date: Sun, 16 Feb 2014 18:02:20 +0000 (UTC) From: "Gabriel Reid (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CRUNCH-346) Don't deep-copy immutable Writable PTypes 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/CRUNCH-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13902765#comment-13902765 ] Gabriel Reid commented on CRUNCH-346: ------------------------------------- Ok, I'll put together a patch for this. About the fact that the correct primitive handling is only done for Avro -- there's no technical reason for this, as far as I'm aware. Instead, it's just that the the short-circuiting to a no-op for the deep-copying was never done for Writables. All of your understanding of the deep-copying is correct as you described it. > Don't deep-copy immutable Writable PTypes > ----------------------------------------- > > Key: CRUNCH-346 > URL: https://issues.apache.org/jira/browse/CRUNCH-346 > Project: Crunch > Issue Type: Improvement > Reporter: Chao Shi > > I found getDetachedValue() appears quite often when jstack on one of my pipeline. A piece of stacktrace is shown below. In the pipeline, most of types we used are immutable (e.g. java primitives, strings, protobuf). I think we can avoid deep-copy overhead here. > "main" prio=10 tid=0x00007f0de801d800 nid=0x7ef runnable [0x00007f0dee66c000] > java.lang.Thread.State: RUNNABLE > at org.apache.hadoop.io.BytesWritable.(BytesWritable.java:52) > at org.apache.hadoop.io.BytesWritable.(BytesWritable.java:46) > at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at java.lang.Class.newInstance0(Class.java:355) > at java.lang.Class.newInstance(Class.java:308) > at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(WritableDeepCopier.java:63) > at org.apache.crunch.types.writable.WritableDeepCopier.deepCopy(WritableDeepCopier.java:36) > at org.apache.crunch.types.writable.WritableType.getDetachedValue(WritableType.java:125) > at org.apache.crunch.impl.mr.emit.IntermediateEmitter.emit(IntermediateEmitter.java:54) -- This message was sent by Atlassian JIRA (v6.1.5#6160)