On Tue, Jul 5, 2011 at 5:52 AM, Michael Bedward
<[email protected]>wrote:

> Hi again Andrea,
>
> Jody and I chatted on IRC a while ago about how using these functions
> with rasters and how bad this would be :)  We were talking in
> particular about InterpolateFunction and wondered about compiling the
> interpolation expression to bytecode using Janino. What do you think ?
>

On the fly compilation of classes will put the results in the permanent
generation,
depending on the garbage collector chosen it will result in a memory leak in
the permanent generation (once put there there might be no way to reclaim
them).
This actually depends on what happens to the classloader that loaded the
classes,
not sure what the janino one does (like, does every compiled class have its
own class loader that gets phased out after a while allowing the class
bytecode
to be garbage collected?), it needs some more investigation.

Like in the recode function building a optimized bit of code taking the
recode/interpolation/reclassify static table and have it run it's likely
going to
be the best option, no runtime code generation and guaranteed optimal
performance for the common case, and requires no extra jars in the
classpath.

Maybe we could setup some sort of plugin system allowing to build a janino
based
optimized version if you have a jar with this accelerated function builder
of sorts?
The other thing that I'm not sure about is type handling and conversions:
much
of the slowness in the current system is due to dynamic evaluation and
type conversion, however that is also part of the expected behavior, like
for
example, if one of the data elements had a function that evaluates into a
string, but I need a number, the current code would compensate via
converters,
what would the janino based code do?
If it uses converters as well wouldn't we giving up much of the speedup?

Cheers
Andrea


-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to