bug-jel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-jel] Data type of compiled expressions


From: Konstantin L. Metlov
Subject: RE: [Bug-jel] Data type of compiled expressions
Date: Fri, 29 Nov 2002 20:23:26 +0100 (CET)

Dear Mike,

> I do need to make use of the resolver interface, as I do some fairly complex
> dynamic resolution. I simplified my example quite a bit.
A gain in performance can still be achieved by using the newly introduced
DVmap class instead of DVresolver, which allows to translate the variable
names at compile-time into values of Java primitive types (e.g. integers).
This way it is possible (but can be tricky, with feasibility depending on
a particular application) to eliminate string lookups of variable names
during the expression run-time and replace them by direct indexed access.

> I'm wondering if there are still performance improvements to be gained by
> using the evaluate_int (for example) if I am going to construct a Java
> object from the primitive or does this basically amount to the same as just
> using evaluate?
There is a very small one, because evaluate() does type checking, whereas
new Integer(evaluate_int()) (or similar, with any other specialized
version of evaluate) does not.

This performance gain will be very small (because type checking is done 
by integer switch) compared to potential performance gains from using Java
primitive types (eliminating object creation/garmage collection) and 
eliminating variable name lookups at compile-time.

With the best regards,
                        Konstantin.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]