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

Paul Elschot commented on LUCENE-1410:
--------------------------------------

There is a margin indeed, but it depends on the cache size. For the decoding of 
all 32 FrameOfRef cases, a rough estimation would be 32 cases * (av. 16 indexed 
reads, 32 shifts, 32 masks, 32 indexed writes) = 32 * 112 = 3500 instructions. 
With 3 bytes per instruction on avarage that would be about 10k byte, in a 
normal instruction cache of 16k or 32k byte.
For Simple9 there is a lot less code, (fewer cases, less code per case) but 
when a lot of variations on this are added, perhaps 3k would be needed in total.
So it's not only the number of cases, but also the amount of code per case.
Fortunately not all cases are used frequently, so they won't appear in the 
instruction cache.

This can be compared that to the code needed for VByte, which is just about 
nothing.

During query execution there are other things in the instruction cache, too, 
for example the code of the Scorers used by the query and the code to get the 
data from the index.
Initially the byte code interpreter and the JIT compiler of the JVM are also in 
the instruction cache, but they normally disappear when the JIT is finished. 
But with more code, the JIT will take longer to finish.


> PFOR implementation
> -------------------
>
>                 Key: LUCENE-1410
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1410
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Other
>            Reporter: Paul Elschot
>            Priority: Minor
>         Attachments: autogen.tgz, LUCENE-1410-codecs.tar.bz2, 
> LUCENE-1410b.patch, LUCENE-1410c.patch, LUCENE-1410d.patch, 
> LUCENE-1410e.patch, TermQueryTests.tgz, TestPFor2.java, TestPFor2.java, 
> TestPFor2.java
>
>   Original Estimate: 21840h
>  Remaining Estimate: 21840h
>
> Implementation of Patched Frame of Reference.

-- 
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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to