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 17EAD10CB2 for ; Mon, 31 Mar 2014 14:44:02 +0000 (UTC) Received: (qmail 88380 invoked by uid 500); 31 Mar 2014 14:43:58 -0000 Delivered-To: apmail-crunch-dev-archive@crunch.apache.org Received: (qmail 86633 invoked by uid 500); 31 Mar 2014 14:43:49 -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 86490 invoked by uid 500); 31 Mar 2014 14:43:44 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 86449 invoked by uid 99); 31 Mar 2014 14:43:41 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2014 14:43:41 +0000 Date: Mon, 31 Mar 2014 14:43:41 +0000 (UTC) From: "Chao Shi (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CRUNCH-368) TupleWritable.Comparator 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-368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955232#comment-13955232 ] Chao Shi commented on CRUNCH-368: --------------------------------- Hi Josh, I think this was a bug (I'm not very sure). The code before this patch may compare two WritableComparable of different concrete type. The below code is an example in IntWritable#compareTo, which does not handle comparison with different type correctly. {code} /** Compares two IntWritables. */ @Override public int compareTo(IntWritable o) { int thisValue = this.value; int thatValue = o.value; return (thisValue TupleWritable.Comparator > ------------------------ > > Key: CRUNCH-368 > URL: https://issues.apache.org/jira/browse/CRUNCH-368 > Project: Crunch > Issue Type: Improvement > Components: Core > Affects Versions: 0.10.0, 0.8.3 > Reporter: Chao Shi > Assignee: Chao Shi > Attachments: crunch-368 benchmark.pdf, crunch-368.patch, gen_data.py > > > This patch should improve comparison performance on TupleWritables. It saves the deserialization overhead. It is particularly useful when the input tuple are large, e.g. contains long strings. > Please note that this changes the binary format of TupleWritable. It adds a var-int indicating size of field after each type code. This is a limitation of the writable system. We do not know the size of each field until fully desalinizing it. -- This message was sent by Atlassian JIRA (v6.2#6252)