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 6862C200BA7 for ; Fri, 21 Oct 2016 15:47:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 670DE160AE0; Fri, 21 Oct 2016 13:47:00 +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 AE6C0160AE8 for ; Fri, 21 Oct 2016 15:46:59 +0200 (CEST) Received: (qmail 69792 invoked by uid 500); 21 Oct 2016 13:46:58 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 69774 invoked by uid 99); 21 Oct 2016 13:46:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2016 13:46:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 798412C0D52 for ; Fri, 21 Oct 2016 13:46:58 +0000 (UTC) Date: Fri, 21 Oct 2016 13:46:58 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-9546) There is a lot of unnecessary boxing/unboxing going on in {{SolrParams}} class MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 21 Oct 2016 13:47:00 -0000 [ https://issues.apache.org/jira/browse/SOLR-9546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15595127#comment-15595127 ] ASF subversion and git services commented on SOLR-9546: ------------------------------------------------------- Commit 49ca9cea7283ab54086fdedd09889d171c777052 in lucene-solr's branch refs/heads/master from [~noble.paul] [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=49ca9ce ] SOLR-9546: reverted some changes > There is a lot of unnecessary boxing/unboxing going on in {{SolrParams}} class > ------------------------------------------------------------------------------ > > Key: SOLR-9546 > URL: https://issues.apache.org/jira/browse/SOLR-9546 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) > Reporter: Pushkar Raste > Priority: Minor > Attachments: SOLR-9546.patch > > > Here is an excerpt > {code} > public Long getLong(String param, Long def) { > String val = get(param); > try { > return val== null ? def : Long.parseLong(val); > } > catch( Exception ex ) { > throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, ex.getMessage(), ex ); > } > } > {code} > {{Long.parseLong()}} returns a primitive type but since method expect to return a {{Long}}, it needs to be wrapped. There are many more method like that. We might be creating a lot of unnecessary objects here. > I am not sure if JVM catches upto it and somehow optimizes it if these methods are called enough times (or may be compiler does some modifications at compile time) > Let me know if I am thinking of some premature optimization -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org