You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tzvika Barenholz (JIRA)" <ji...@apache.org> on 2007/11/19 15:55:43 UTC

[jira] Created: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

bad java practices which affect performance (result of code inspection)
-----------------------------------------------------------------------

                 Key: LUCENE-1059
                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Tzvika Barenholz
            Priority: Minor


IntelliJ IDEA found the following issues in the Lucense source code and tests:

1) explicit for loops where calls to System.arraycopy() should have been
2) calls to Boolean constructor (in stead of the appropriate static method/field)
3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls

all minor issues. patch is forthcoming.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-1059:
---------------------------------------

    Attachment: LUCENE-1059.take2.patch

OK patch looks good to me!  Thanks Tzvika!

One thing is QueryParser.java can't be changed (that code is
auto-written by JavaCC).  Also I changed some of the single-character
append's from a size 1 string to a single character as suggested above
by Uwe Schindler.  Attached new patch with these changes.  I plan
to commit in a day or two.


> bad java practices which affect performance (result of code inspection)
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-1059
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Tzvika Barenholz
>            Priority: Minor
>         Attachments: inspections.diff, LUCENE-1059.take2.patch
>
>
> IntelliJ IDEA found the following issues in the Lucense source code and tests:
> 1) explicit for loops where calls to System.arraycopy() should have been
> 2) calls to Boolean constructor (in stead of the appropriate static method/field)
> 3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
> 4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls
> all minor issues. patch is forthcoming.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

Posted by "Tzvika Barenholz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tzvika Barenholz updated LUCENE-1059:
-------------------------------------

    Attachment: inspections.diff

patch (svn diff) that fixes the issue

> bad java practices which affect performance (result of code inspection)
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-1059
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Tzvika Barenholz
>            Priority: Minor
>         Attachments: inspections.diff
>
>
> IntelliJ IDEA found the following issues in the Lucense source code and tests:
> 1) explicit for loops where calls to System.arraycopy() should have been
> 2) calls to Boolean constructor (in stead of the appropriate static method/field)
> 3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
> 4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls
> all minor issues. patch is forthcoming.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-1059.
----------------------------------------

       Resolution: Fixed
    Lucene Fields: [New, Patch Available]  (was: [Patch Available, New])

I just committed this.  Thanks Tzvika!

> bad java practices which affect performance (result of code inspection)
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-1059
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Tzvika Barenholz
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: inspections.diff, LUCENE-1059.take2.patch
>
>
> IntelliJ IDEA found the following issues in the Lucense source code and tests:
> 1) explicit for loops where calls to System.arraycopy() should have been
> 2) calls to Boolean constructor (in stead of the appropriate static method/field)
> 3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
> 4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls
> all minor issues. patch is forthcoming.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless reassigned LUCENE-1059:
------------------------------------------

    Assignee: Michael McCandless

> bad java practices which affect performance (result of code inspection)
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-1059
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Tzvika Barenholz
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: inspections.diff, LUCENE-1059.take2.patch
>
>
> IntelliJ IDEA found the following issues in the Lucense source code and tests:
> 1) explicit for loops where calls to System.arraycopy() should have been
> 2) calls to Boolean constructor (in stead of the appropriate static method/field)
> 3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
> 4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls
> all minor issues. patch is forthcoming.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (LUCENE-1059) bad java practices which affect performance (result of code inspection)

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12543587 ] 

Uwe Schindler commented on LUCENE-1059:
---------------------------------------

A small speed improvement in the StringBuffer/-Builder parts could be achieved by replacing buffer.append(String) with single-character Strings by buffer.append(char).

If we move to Java 1.5 for a later Lucene version you should replace StringBuffer by StringBuilder.

> bad java practices which affect performance (result of code inspection)
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-1059
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1059
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Tzvika Barenholz
>            Priority: Minor
>         Attachments: inspections.diff
>
>
> IntelliJ IDEA found the following issues in the Lucense source code and tests:
> 1) explicit for loops where calls to System.arraycopy() should have been
> 2) calls to Boolean constructor (in stead of the appropriate static method/field)
> 3) instantiation of unnecessary Integer instances for toString, instead of calling the static one
> 4) String concatenation using + inside a call to StringBuffer.append(), in stead of chaining the append calls
> all minor issues. patch is forthcoming.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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