[ 
https://issues.apache.org/jira/browse/SOLR-9546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15543012#comment-15543012
 ] 

ASF GitHub Bot commented on SOLR-9546:
--------------------------------------

GitHub user praste opened a pull request:

    https://github.com/apache/lucene-solr/pull/88

    SOLR-9546 Refactored to use primitives instead of wrappers

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/praste/lucene-solr SOLR-9546

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #88
    
----
commit f77b31bd038abe8cb974240424fd072a35adae4f
Author: Pushkar Raste <pra...@bloomberg.net>
Date:   2016-10-03T18:04:24Z

    SOLR-9546 Refactored to use primitives instead of wrappers

----


> 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
>
> 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-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to