You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by shuigen kang <ka...@gmail.com> on 2011/05/12 10:01:21 UTC

a optimizable point about solr

Hi all:

      *I was recently used solr to set up a Search Engine for our web site.
In the process of performance test, I used jprofiler to analyse the
operational aspect of solr , And found a optimizable point, in the method
 getLuceneVersion(String path, Version def) of class
org.apache.solr.core.config. In this method,it will parse the config file
with xml format each time when be invoked.*

*it is terrible,look this:*

*
*

http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg

http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg


*15.1%+14.2%, it cost 29.3% cpu resource,only a be of little use method. *

*So I suggest to edit this method like this:*


------------------------------------------------------------------------

*public* Version getLuceneVersion(String path) {

       *if*(luceneVersion == *null*){

          luceneVersion = *parseLuceneVersionString*(getVal(path, *true*));

       }

     *return* luceneVersion;
   }
------------------------------------------------------------------------

*Only run parseLuceneVersionString() method at this first time to save the
valuable and limited cpu resource.*

* *

*Any problem and what do you think?*



Best regards.


**

答复: a optimizable point about solr

Posted by 卜沉 <bu...@taobao.com>.
additional remarks: I used solr with version 3.1

-----邮件原件-----
发件人: simon.willnauer@googlemail.com [mailto:simon.willnauer@googlemail.com] 代表 Simon Willnauer
发送时间: 2011年5月12日 16:07
收件人: shuigen kang
抄送: dev@lucene.apache.org; 卜沉
主题: Re: a optimizable point about solr

Hey good catch :)

we already addressed this issue AFAIK here:
https://issues.apache.org/jira/browse/SOLR-2493

so the question is if we need to do another release since it seems serious.

simon

2011/5/12 shuigen kang <ka...@gmail.com>:
> Hi all:
>
>       I was recently used solr to set up a Search Engine for our web site.
> In the process of performance test, I used jprofiler to analyse the
> operational aspect of solr , And found a optimizable point, in the method
>  getLuceneVersion(String path, Version def) of class
> org.apache.solr.core.config. In this method,it will parse the config file
> with xml format each time when be invoked.
>
> it is terrible,look this:
>
> http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg
>
> http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg
>
> 15.1%+14.2%, it cost 29.3% cpu resource,only a be of little use method.
>
> So I suggest to edit this method like this:
>
> ------------------------------------------------------------------------
>
> public Version getLuceneVersion(String path) {
>
>        if(luceneVersion == null){
>
>           luceneVersion = parseLuceneVersionString(getVal(path, true));
>
>        }
>
>      return luceneVersion;
>
>    }
> ------------------------------------------------------------------------
>
> Only run parseLuceneVersionString() method at this first time to save the
> valuable and limited cpu resource.
>
>
>
> Any problem and what do you think?
>
>
>
> Best regards.
>
>

This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。

Re: a optimizable point about solr

Posted by Simon Willnauer <si...@apache.org>.
Hey good catch :)

we already addressed this issue AFAIK here:
https://issues.apache.org/jira/browse/SOLR-2493

so the question is if we need to do another release since it seems serious.

simon

2011/5/12 shuigen kang <ka...@gmail.com>:
> Hi all:
>
>       I was recently used solr to set up a Search Engine for our web site.
> In the process of performance test, I used jprofiler to analyse the
> operational aspect of solr , And found a optimizable point, in the method
>  getLuceneVersion(String path, Version def) of class
> org.apache.solr.core.config. In this method,it will parse the config file
> with xml format each time when be invoked.
>
> it is terrible,look this:
>
> http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg
>
> http://dl.iteye.com/upload/picture/pic/89884/00ff1ee5-a156-354d-8eaa-35abdcd1cfa6.jpg
>
> 15.1%+14.2%, it cost 29.3% cpu resource,only a be of little use method.
>
> So I suggest to edit this method like this:
>
> ------------------------------------------------------------------------
>
> public Version getLuceneVersion(String path) {
>
>        if(luceneVersion == null){
>
>           luceneVersion = parseLuceneVersionString(getVal(path, true));
>
>        }
>
>      return luceneVersion;
>
>    }
> ------------------------------------------------------------------------
>
> Only run parseLuceneVersionString() method at this first time to save the
> valuable and limited cpu resource.
>
>
>
> Any problem and what do you think?
>
>
>
> Best regards.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org