Andrea Aime a écrit :
> Ouch, this hurts... looking at scalability profiles I noticed
> that those statements are called very often and they are limiting
> the scalability, especially when going beyond 20 client threads and
> working with features.
In my own code, I do not invoke FactoryFinder often... I tend to invoke them at
some object initialization time and keep the factories in the object inner
fields. It is not only a matter of performance, but also a matter of stability.
A non-trivial code get very unexpected results when the factory can change in
the middle of a computation. Typical example is:
1) Projection some envelope to WGS84
2) performs calculation
3) Projecting back to the original CRS.
If the factory changed between 1 and 3 and if the new factory produces slightly
different CRS (e.g. slightly different BursaWolf parameters), then the result
have a slight offset compared to the expected results. Such offset caused by a
different in factory are sometime hard to debug.
> If a cache is already maintained, shouldn't the calls return very
> much? Yet in that case I should not see thread contention over
> CommonFactoryFinder...
The search in the cache is performed in a synchronized block as well. It is not
something like looking for a key in a hash map. It is something more elaborated
involving a comparaison of hints, looking for factories dependencies and check
recursively the hints in the dependencies as well, etc.
Any chance that Geoserver keep more long-time reference to the factories it
use?
It could be helpful for result stability as well...
Martin
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel