lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <ysee...@gmail.com>
Subject Re: svn commit: r411882 - in /incubator/solr/trunk: CHANGES.txt src/java/org/apache/solr/analysis/KeywordTokenizerFactory.java src/test/org/apache/solr/BasicFunctionalityTest.java src/test/test-files/
Date Mon, 05 Jun 2006 19:30:19 GMT
On 6/5/06, Chris Hostetter <hossman_lucene@fucit.org> wrote:
> I just wish it wasn't neccessary to have all these Factories ... has
> anyone done any serious bnchmarking of the cost of reflection in a case
> like this? ... if getting a Class by name is the expensive part, we can do
> that once when the config is loaded -- it's just a question of how
> "clazz.newInstance() performs relative to "new Foo()"

A factory is certainly necessary sometimes.  You don't want to incur
setup time for creating a SynonymMap or a StopSet for every instance
you create.

For simpler tokenizers or token filters, it would be nice to be able
to use them directly.
Perhaps we could look at the class type, and if it's a lucene
Tokenizer or TokenFilter, try instantiating it directly with
newInstance().

At schema creation time, we should probably check if the specified
Tokenizer or TokenFilter has a default constructor.  If it doesn't we
should throw an error right then, not waiting for a confusing runtime
exception.

-Yonik

Mime
View raw message