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

Adrien Grand commented on LUCENE-7966:
--------------------------------------

Here are the results:

|| File || Time to compress without patch || Time to compress with the patch 
||Difference ||
| bib | 976672 | 935724 | -4.2% |
| book1 | 7487574 | 7300402 | -2.5% |
| book2 | 4999043 | 4719148 | -5.6% |
| geo | 1598629 | 1648771 | 3.1% |
| news | 3398425 | 3289187 | -3.2% |
| obj1 | 169515 | 167649 | -1.1% |
| obj2 | 1873220 | 1804144 | -3.7% |
| paper1 | 386047 | 364133 | -5.7% |
| paper2 | 726156 | 695761 | -4.2% |
| paper3 | 375937 | 359946 | -4.3% |
| paper4 | 111643 | 108169 | -3.1% |
| paper5 | 99465 | 96254 | -3.2% |
| paper6 | 277771 | 263810 | -5.0% |
| pic | 1528434 | 1324520 | -13.3% |
| progc | 279360 | 265820 | -4.8% |
| progl | 411285 | 385095 | -6.4% |
| progp | 246035 | 226135 | -8.1% |
| trans | 517765 | 485948 | -6.1% |

Results are slightly less good than previously but it could well be noise. It's 
still an improvement compared to master.

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to