lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dawid Weiss (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3807) Cleanup suggester API
Date Fri, 02 Mar 2012 13:51:57 GMT

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

Dawid Weiss commented on LUCENE-3807:
-------------------------------------

I looked at your patch briefly, Simon. Random notes:

- I'd change currentElement into lastElement or something like that. Otherwise it looks odd
to me in the code, as in:
{code}
     throw new IndexOutOfBoundsException("index " + pos
         + " must be less than the size: " + currentElement);
{code}

- typo in "orderdEntries".

- I'm very likely paranoid but I'd stick to just one class for storing these:
{code}
protected Number weightAsNumber(long weight) {
{code}
Since these are objects the memory gain will most likely be obscured by object alignments
and object overhead itself and the downside is that you're using an interface with all call
sites that will very likely become megamorphic (so no chances to inline anything). I don't
know if it's worth the effort.

I didn't have time to think much about changes to the functional logic; I don't think there
were any (and if there were, they should be covered by tests?).

                
> Cleanup suggester API
> ---------------------
>
>                 Key: LUCENE-3807
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3807
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: modules/other
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>             Fix For: 4.0
>
>         Attachments: LUCENE-3807.patch, LUCENE-3807.patch, LUCENE-3807.patch, LUCENE-3807.patch,
LUCENE-3807.patch, LUCENE-3807.patch
>
>
> Currently the suggester api and especially TermFreqIterator don't play that nice with
BytesRef and other paradigms we use in lucene, further the java iterator pattern isn't that
useful when it gets to work with TermsEnum, BytesRef etc. We should try to clean up this api
step by step moving over to BytesRef including the Lookup class and its interface...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message