You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Paul Elschot (JIRA)" <ji...@apache.org> on 2010/01/16 14:47:54 UTC

[jira] Created: (LUCENE-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

SortedVIntList allocation should use ArrayUtils.getNextSize()
-------------------------------------------------------------

                 Key: LUCENE-2217
                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Other
            Reporter: Paul Elschot


See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803266#action_12803266 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

Paul, I just committed LUCENE-2213, which changes name & signature of ArrayUtil.getNextSize.... so be sure to update & merge before taking the patch further!

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Michael McCandless updated LUCENE-2217:
---------------------------------------

    Attachment: LUCENE-2217.patch

Small tweaks on the last patch, also adding ArrayUtil.getNextSize when allocating the char[] in IndexInput.

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804691#action_12804691 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

Patch looks good, all tests pass. Thanks for simplifying the added testcase.
After this I'll post a clean patch at LUCENE-2232 .

> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Attachment: LUCENE-2217.patch

Fixed the reallocation to be actually done and added a test case that fails the previous patch because of the missing reallocation.

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Priority: Trivial  (was: Major)

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802449#action_12802449 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

Btw. shouldn't IndexInput.bytes also be reallocated using ArrayUtils.getNextSize() ?
The growth factor there is a hardcoded 1.25 .

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Attachment: LUCENE-2217.patch

Patch of 21 Jan is as anticipated, except for the following:

UnicodeUtil.java last reallocation at line 332 unchanged.

FastCharStream.java change might affect speed, not included in patch.

TermsHashPerField unchanged.

BufferedIndexInput unchanged, only used by clone() in MultiLevelSkipListReader.


> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Attachment: LUCENE-2217.patch

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Attachment: LUCENE-2217.patch

Patch of 20 Jan also includes use of ArrayUtil.getNextSize() for allocation in IndexInput.

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

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

Michael McCandless reassigned LUCENE-2217:
------------------------------------------

    Assignee: Michael McCandless

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802456#action_12802456 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

bq. Btw. shouldn't IndexInput.bytes also be reallocated using ArrayUtils.getNextSize()

+1  Wanna fold it into this patch?  (And any others you find..?).

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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] Issue Comment Edited: (LUCENE-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802850#action_12802850 ] 

Paul Elschot edited comment on LUCENE-2217 at 1/20/10 2:40 PM:
---------------------------------------------------------------

Since I missed the second one in IndexInput I used this regex to search the java files in trunk/src/java: {noformat} new .*\[.*\] {noformat}
and found that these are still suspicious:

PorterStemmer 85, 485
StandardTokenizerImpl  447
ByteBlockPool 86
CharBlockPool 45
MultipleTermPositions 86
TermInfosWriter 210
TermsHashPerField 527 (maybe)
TermVectorsReader 463, 472
FastCharStream 58
BufferedIndexInput 61, 157
UnicodeUtil, 7 times or more.




      was (Author: paul.elschot@xs4all.nl):
    Since I missed the second one in IndexInput I used this regex to search *.java in trunk/src/java: new .*\[.*\]
and found that these are still suspicious:

PorterStemmer 85, 485
StandardTokenizerImpl  447
ByteBlockPool 86
CharBlockPool 45
MultipleTermPositions 86
TermInfosWriter 210
TermsHashPerField 527 (maybe)
TermVectorsReader 463, 472
FastCharStream 58
BufferedIndexInput 61, 157
UnicodeUtil, 7 times or more.



  
> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802850#action_12802850 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

Since I missed the second one in IndexInput I used this regex to search *.java in trunk/src/java: new .*\[.*\]
and found that these are still suspicious:

PorterStemmer 85, 485
StandardTokenizerImpl  447
ByteBlockPool 86
CharBlockPool 45
MultipleTermPositions 86
TermInfosWriter 210
TermsHashPerField 527 (maybe)
TermVectorsReader 463, 472
FastCharStream 58
BufferedIndexInput 61, 157
UnicodeUtil, 7 times or more.




> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803263#action_12803263 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

I agree we should cutover these additional places -- wanna work into the patch?

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

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

Michael McCandless resolved LUCENE-2217.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1

Thanks Paul!

> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>             Fix For: 3.1
>
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801356#action_12801356 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

bq.  I'll also try and add a test case that fails when an allocation larger than the current initial size is needed

That would be much appreciated ;)  (I hit that too!).

bq. The underlying problem is that ArrayUtils.getNextSize() does not have an argument for a minimum increase.  Would it make sense to add that, too?

Well... the arg to getNextSize is already the minimum size that must be returned, so, can't you just pass in lastBytePos + MAX_BYTES_PER_INT?

{quote}
The code there has some strange constants (3, 6 and 9) that could
perhaps be dropped when an extra argument for a minimum increase is added.
Looking at the comment there for the growth pattern, shouldn't the second number (after 0) be 3 instead of 4?
{quote}
We're working on cleaning up this method, under LUCENE-2213.  The growth pattern in the comment is in fact correct, if you were to call getNextSize on 1+ the current size, ie this progression:

{code}
getNextSize(1+getNextSize(1+getNextSize(1+....getNextSize(1+0)))))
{code}


> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

    Lucene Fields: [New]  (was: [Patch Available, New])
          Summary: Remaining reallocation should use ArrayUtil.getNextSize()  (was: SortedVIntList allocation should use ArrayUtils.getNextSize())

> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802510#action_12802510 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

Well, it's not that I'm searching, but I'll provide another patch that includes IndexInput for this.

Would you have any idea about testcases for that?
:)



> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

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

Paul Elschot updated LUCENE-2217:
---------------------------------

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

> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801254#action_12801254 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

Actually the patch isn't quite right, I think?  First, it just calls ArrayUtil.getNextSize w/o passing that to resizeBytes?

Second, it needs to pass lastBytePos + MAX_BYTES_PER_INT as the arg to ArrayUtil.getNextSize (ie, that's the "min target size")?

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12803380#action_12803380 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

That was expected.

The next patch will be about 5 times bigger, so I'll need some more time.

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) Remaining reallocation should use ArrayUtil.getNextSize()

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

Michael McCandless updated LUCENE-2217:
---------------------------------------

    Attachment: LUCENE-2217.patch

New iteration of patch attached:

  * Recovered the fixes in my first patch

  * Cutover some ArrayUtil.oversize -> ArrayUtil.grow

  * We can't change StandardTokenizerImpl.java -- it's autogen'd from
    JFlex


> Remaining reallocation should use ArrayUtil.getNextSize()
> ---------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch, LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801253#action_12801253 ] 

Michael McCandless commented on LUCENE-2217:
--------------------------------------------

Makes sense!

> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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-2217) SortedVIntList allocation should use ArrayUtils.getNextSize()

Posted by "Paul Elschot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801295#action_12801295 ] 

Paul Elschot commented on LUCENE-2217:
--------------------------------------

Indeed, the patch isn't quite right. I'll fix that and provide another patch. All test cases pass though, so I'll also try and
add a test case that fails when an allocation larger than the current initial size is needed.

The MAX_BYTE_PER_INT has disappeared into an added comment that states a minimum initial size.
The underlying problem is that ArrayUtils.getNextSize() does not have an argument for a minimum increase.
Would it make sense to add that, too? The code there has some strange constants  (3, 6 and 9) that could
perhaps be dropped when an extra argument for a minimum increase is added.
Looking at the comment there for the growth pattern, shouldn't the second number (after 0) be 3 instead of 4?


> SortedVIntList allocation should use ArrayUtils.getNextSize()
> -------------------------------------------------------------
>
>                 Key: LUCENE-2217
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2217
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>            Reporter: Paul Elschot
>            Assignee: Michael McCandless
>            Priority: Trivial
>         Attachments: LUCENE-2217.patch
>
>
> See recent discussion on ArrayUtils.getNextSize().

-- 
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