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

Adrien Grand edited comment on LUCENE-7966 at 9/27/17 12:57 PM:
----------------------------------------------------------------

Now with Java 8

|| File || Time to compress without patch || Time to compress with the patch 
||Difference ||
| bib | 1033357 | 1027901 | -0.5% |
| book1 | 7906551 | 7961422 | +0.7% |
| book2 | 5335458 | 5348388 | +0.2% |
| geo | 1629253 | 1644770 | +1.0% |
| news | 3569115 | 3609734 | +1.1% |
| obj1 | 176601 | 178634 | +1.2% |
| obj2 | 1970078 | 1993204 | +1.2% |
| paper1 | 412884 | 409665 | -0.8% |
| paper2 | 772086 | 772052 | -0.0% |
| paper3 | 401949 | 397526 | -1.1% |
| paper4 | 118664 | 117747 | -0.8% |
| paper5 | 104995 | 104855 | -0.1% |
| paper6 | 296315 | 295813 | -0.2% |
| pic | 1619648 | 1698345 | +4.9% |
| progc | 299270 | 298341 | -0.3% |
| progl | 440063 | 443714 | +0.8% |
| progp | 265607 | 266388 | 0.3% |
| trans | 554452 | 555335 | 0.2% |

The slowdown on pic (the most compressible file) is reproducible but other 
files show very similar performance with and without the patch.


was (Author: jpountz):
Now with Java 8

|| File || Time to compress without patch || Time to compress with the patch 
||Difference ||
| bib | 1033357 | 1027901 | -0.5 |
| book1 | 7906551 | 7961422 | 0.7 |
| book2 | 5335458 | 5348388 | 0.2 |
| geo | 1629253 | 1644770 | 1.0 |
| news | 3569115 | 3609734 | 1.1 |
| obj1 | 176601 | 178634 | 1.2 |
| obj2 | 1970078 | 1993204 | 1.2 |
| paper1 | 412884 | 409665 | -0.8 |
| paper2 | 772086 | 772052 | -0.0 |
| paper3 | 401949 | 397526 | -1.1 |
| paper4 | 118664 | 117747 | -0.8 |
| paper5 | 104995 | 104855 | -0.1 |
| paper6 | 296315 | 295813 | -0.2 |
| pic | 1619648 | 1698345 | 4.9 |
| progc | 299270 | 298341 | -0.3 |
| progl | 440063 | 443714 | 0.8 |
| progp | 265607 | 266388 | 0.3 |
| trans | 554452 | 555335 | 0.2 |

The slowdown on pic (the most compressible file) is reproducible but other 
files show very similar performance with and without the patch.

> build mr-jar and use some java 9 methods if available
> -----------------------------------------------------
>
>                 Key: LUCENE-7966
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7966
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other, general/build
>            Reporter: Robert Muir
>              Labels: Java9
>         Attachments: LUCENE-7966.patch, LUCENE-7966.patch, LUCENE-7966.patch, 
> LUCENE-7966.patch, LUCENE-7966.patch
>
>
> See background: http://openjdk.java.net/jeps/238
> It would be nice to use some of the newer array methods and range checking 
> methods in java 9 for example, without waiting for lucene 10 or something. If 
> we build an MR-jar, we can start migrating our code to use java 9 methods 
> right now, it will use optimized methods from java 9 when thats available, 
> otherwise fall back to java 8 code.  
> This patch adds:
> {code}
> Objects.checkIndex(int,int)
> Objects.checkFromToIndex(int,int,int)
> Objects.checkFromIndexSize(int,int,int)
> Arrays.mismatch(byte[],int,int,byte[],int,int)
> Arrays.compareUnsigned(byte[],int,int,byte[],int,int)
> Arrays.equal(byte[],int,int,byte[],int,int)
> // did not add char/int/long/short/etc but of course its possible if needed
> {code}
> It sets these up in {{org.apache.lucene.future}} as 1-1 mappings to java 
> methods. This way, we can simply directly replace call sites with java 9 
> methods when java 9 is a minimum. Simple 1-1 mappings mean also that we only 
> have to worry about testing that our java 8 fallback methods work.
> I found that many of the current byte array methods today are willy-nilly and 
> very lenient for example, passing invalid offsets at times and relying on 
> compare methods not throwing exceptions, etc. I fixed all the instances in 
> core/codecs but have not looked at the problems with AnalyzingSuggester. Also 
> SimpleText still uses a silly method in ArrayUtil in similar crazy way, have 
> not removed that one yet.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to