Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9F872009F3 for ; Fri, 20 May 2016 19:29:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A8640160A24; Fri, 20 May 2016 17:29:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EF42D1609AE for ; Fri, 20 May 2016 19:29:49 +0200 (CEST) Received: (qmail 97595 invoked by uid 500); 20 May 2016 17:29:49 -0000 Mailing-List: contact dev-help@datafu.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@datafu.incubator.apache.org Delivered-To: mailing list dev@datafu.incubator.apache.org Received: (qmail 97584 invoked by uid 99); 20 May 2016 17:29:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2016 17:29:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 33DFF180592 for ; Fri, 20 May 2016 17:29:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.819 X-Spam-Level: X-Spam-Status: No, score=-0.819 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Ci5zsuN3B00S for ; Fri, 20 May 2016 17:29:47 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id E02215F474 for ; Fri, 20 May 2016 17:29:46 +0000 (UTC) Received: (qmail 97547 invoked by uid 99); 20 May 2016 17:29:46 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2016 17:29:46 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id C56F02C1A8D; Fri, 20 May 2016 17:29:45 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2927237567923281254==" MIME-Version: 1.0 Subject: Re: Review Request 46701: DATAFU-117 - New UDF - CountDistinctUpTo From: Matthew Hayes To: Matthew Hayes , DataFu , Eyal Allweil Date: Fri, 20 May 2016 17:29:45 -0000 Message-ID: <20160520172945.1678.16965@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Matthew Hayes X-ReviewGroup: DataFu X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/46701/ X-Sender: Matthew Hayes References: <20160518221916.1677.88301@reviews.apache.org> In-Reply-To: <20160518221916.1677.88301@reviews.apache.org> X-ReviewBoard-Diff-For: datafu-pig/src/main/java/datafu/pig/bags/CountDistinctUpTo.java Reply-To: Matthew Hayes X-ReviewRequest-Repository: datafu archived-at: Fri, 20 May 2016 17:29:50 -0000 --===============2927237567923281254== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On May 18, 2016, 10:19 p.m., Matthew Hayes wrote: > > datafu-pig/src/main/java/datafu/pig/bags/CountDistinctUpTo.java, line 147 > > > > > > What about clearing the set so we don't have to garbage collect? > > Eyal Allweil wrote: > I just reassigned it because the clear() method in HashSet uses Array.fill and I thought it would be more expensive than just letting it be garbage collected and making a new one. I would think GCing the hashset would be more expensive than clearing. I did a quick benchmark and it seems that clear is significantly faster for large and small hashsets. - Matthew ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46701/#review133803 ----------------------------------------------------------- On April 27, 2016, 7:44 a.m., Eyal Allweil wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46701/ > ----------------------------------------------------------- > > (Updated April 27, 2016, 7:44 a.m.) > > > Review request for DataFu. > > > Repository: datafu > > > Description > ------- > > DATAFU-117 - New UDF - CountDistinctUpTo > > > Diffs > ----- > > datafu-pig/src/main/java/datafu/pig/bags/CountDistinctUpTo.java PRE-CREATION > datafu-pig/src/test/java/datafu/test/pig/bags/BagTests.java 28292db0c01a1967ea53d9cc3d316e9906d942a8 > > Diff: https://reviews.apache.org/r/46701/diff/ > > > Testing > ------- > > > Thanks, > > Eyal Allweil > > --===============2927237567923281254==--