[
https://issues.apache.org/jira/browse/SOLR-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658754#action_12658754
]
noble.paul edited comment on SOLR-921 at 1/22/09 10:50 PM:
-----------------------------------------------------------
The patch currently caches the result only if the default set of packages are
used . If you pass an extra list of package names , then the result is not
cached. The ideal solution is to consider the package names also in the key .
I have ignored those usecases for simplicity. I have also ignored cases where
classes are loaded by parent classloader. Ideally the classloader also must be
considered for making the key for the cache .
This is useful when cores are loaded/unloaded very frequently and there are a
large number of cores (tens of thousands) . In other cases the perf benefits
are negligible.
When loading plugins they are rarely loaded using the solr.<cname> .If we use a
fully qualified name then the ClassNotFoundExceptions are not thrown and the
cost is low and not worth optimizing. So I have ignored all such cases
Caching the classes on a SolrResopurceLoader instance level means one core
cannot benefit from the 'learnings' of another core.
was (Author: noble.paul):
The patch currently caches the result only if the default set of packages
are used . If you pass an extra list of package names , then the result is not
cached. The ideal solution is to consider the package names also in the key .
I have ignored those usecases for simplicity. I have also ignored cases where
classes are loaded by parent classloader. Ideally the classloader also must be
considered for making the key for the cache .
This is useful when cores are loaded/unloaded very frequently and there are a
large number of cores (tens of thousands) . In other cases the perf benefits
are negligible. So this is not applicable for loading plugins as well.
> SolrResourceLoader must cache name vs class
> -------------------------------------------
>
> Key: SOLR-921
> URL: https://issues.apache.org/jira/browse/SOLR-921
> Project: Solr
> Issue Type: Improvement
> Reporter: Noble Paul
> Fix For: 1.4
>
> Attachments: SOLR-921.patch
>
>
> every class that is loaded through SolrResourceLoader does a Class.forName()
> and when if it is not found a ClassNotFoundExcepton is thrown
> Then , it looks up with the various packages and finds the right class if the
> name starts with solr. Considering the fact that we usually use this
> solr.<classname> format we pay too much of a price for this. After every
> lookup the result can be cached in a Map<String,Class> and can be shared
> across all the cores and this Map can be stored at the CoreContainer level
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.