A few people here have noted that WebMacro uses class analysis
(reflection/introspection) to extract properties from objects
in its template, whereas other systems force you to implement
an adapter class for every object you use.

The speculation is that as a result, WebMacro is slow.

The advantage of using class analysis is that WebMacro allows you
to use your entire Java library, whereas other systems restrict you
to just those classes you have provided adapters for.

Despite this, WebMacro is actually quite fast:

    -- Classes are analyzed only once per JVM: The properties
       available on a class are saved, so that subsequent uses
       of the same class are fast. WebMacro looks up the
       Method to be invoked in its cache, not via introspection.
       This is what the JavaBeans API does as well.

    -- Templates are compiled. WebMacro compiles a template only
       once per JVM. The most expensive aspect of using a template
       is the parsing operation. WebMacro eliminates this cost
       by caching commonly accessed templates in memory, in a
       compiled form.

The next implementation of WebMacro will also include an optimizing
compiler, eliminating common sub-expressions, performing static
analysis to reduce branching, inlining, and so forth, to reduce
the work required at execution time and reduce the number of
objects.

Without these new optimizations WebMacro is already remarkably
fast. I encourage everyone to verify this for themselves by
benchmarking the example servlets WebMacro ships with.

There is no doubt a slight cost in some of the work WebMacro does
for you; I think that saving development time by eliminating
the need to write adapter classes is well worth the  very small cost
of class analysis.

Justin

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to