Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-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 AB08911CED for ; Sun, 8 Jun 2014 18:18:02 +0000 (UTC) Received: (qmail 88500 invoked by uid 500); 8 Jun 2014 18:18:01 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 88345 invoked by uid 500); 8 Jun 2014 18:18:01 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 88200 invoked by uid 99); 8 Jun 2014 18:18:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jun 2014 18:18:01 +0000 Date: Sun, 8 Jun 2014 18:18:01 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: dev@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HBASE-11308) Reuse NameStringPair#Builder instances in loops 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/HBASE-11308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell resolved HBASE-11308. ------------------------------------ Resolution: Won't Fix This is a premature (or never mature) optimization. These calls aren't on hot code paths. > Reuse NameStringPair#Builder instances in loops > ----------------------------------------------- > > Key: HBASE-11308 > URL: https://issues.apache.org/jira/browse/HBASE-11308 > Project: HBase > Issue Type: Task > Reporter: Ted Yu > Priority: Trivial > > The following code is from HColumnDescriptor#convert() but the pattern can be found in other classes, such as HBaseAdmin: > {code} > for (Map.Entry e : this.configuration.entrySet()) { > NameStringPair.Builder aBuilder = NameStringPair.newBuilder(); > aBuilder.setName(e.getKey()); > aBuilder.setValue(e.getValue()); > builder.addConfiguration(aBuilder.build()); > } > {code} > NameStringPair.Builder instance can be reused across iterations of the loop. > This would save creation of short-lived objects. -- This message was sent by Atlassian JIRA (v6.2#6252)