Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4ACF01772D for ; Tue, 30 Sep 2014 06:48:34 +0000 (UTC) Received: (qmail 5418 invoked by uid 500); 30 Sep 2014 06:48:34 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 5377 invoked by uid 500); 30 Sep 2014 06:48:34 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 5360 invoked by uid 99); 30 Sep 2014 06:48:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 06:48:34 +0000 Date: Tue, 30 Sep 2014 06:48:33 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-12117) Constructors that use Configuration may be harmful 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-12117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152868#comment-14152868 ] Andrew Purtell commented on HBASE-12117: ---------------------------------------- This was YCSB running against an all localhost 0.98 cluster. The old YCSB client. This is workload C. traces.client.getHTable.svg is traces.client.c.svg with all sampled call arcs filtered out except those that go through getHTable, in effect zooming in on a portion of the full trace. Workload C is an all read workload. This is a client trace. > Constructors that use Configuration may be harmful > -------------------------------------------------- > > Key: HBASE-12117 > URL: https://issues.apache.org/jira/browse/HBASE-12117 > Project: HBase > Issue Type: Improvement > Reporter: Andrew Purtell > Attachments: traces.client.c.svg, traces.client.getHTable.svg > > > There's a common pattern in HBase code where in the constructor, or in an initialization method also called once per instantiation, or both, we look up values from Hadoop Configuration and store them into fields. This can be expensive if the object is frequently created. Configuration is a heavyweight registry that does a lot of string operations and regex matching. See attached example. Method calls into Configuration account for 48.25% of CPU time when creating the HTable object in 0.98. (The remainder is spent instantiating the RPC controller via reflection, a separate issue that merits followup elsewhere.) Creation of HTable instances is expected to be a lightweight operation if a client is using unmanaged HConnections; however creating HTable instances takes up about 18% of the client's total on-CPU time. This is just one example where constructors that use Configuration may be harmful. -- This message was sent by Atlassian JIRA (v6.3.4#6332)