Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Re: Why are you using LTW?

Hi William,
I've been working on a cache for load time weaved bytecode to preserve it between invocations. I'm not currently actively working on it because the performance benefit I was getting out of it was not significant. Basically, the time it takes to check if there is a cached bytecode, if the originating .class has changed, or if any aspect has changed (cause checking if the actual change influences or not a certain class is too heavy to determine) was often much more than simply sending the bytecode to the weaver.

There are just a few cases where this time is by far lower, but this advantage gets hidden by all the other checks .. as it often happens in many caching systems :)

Equinox Aspects also developed a caching classloader for AspectJ. In the corner case described there (a tracing aspect tracing each and every class in the Eclipse system), both Equinox Aspects and my implementation do obtain huge performance gain, but I made no tests on their implementation on less corner cases, like a system where aspects are each one weaving a few classes, and one of these classes has changed between two restarts. No matter what, their code is better than my experiment :)

Also, in my case, there are a number of other variables at play, like other enhancers : we also have load-time OpenJPA enhancement, and (during tests) compile time Cobertura enhancement. For OpenJPA enhancement the same problem occurs, when dealing with very big beans, with lots of relations and so on, the benefit of caching is interesting, while in other cases it is counterproductive.

Obviously, using a more efficient caching system (caching algorithm, better code and so on) can change the situation, but I had no time to go further in this experiment.

Simone

William Louth (JINSPIRED.COM) wrote:
I am surprised that Ramnivas did not point out that you can in effect have the best of both worlds with a hybrid solution which is extremely powerful when dealing with aspect libraries for diagnostics and resource monitoring as you can configure this without having to go through a complete build cycle. Test and Ops teams do not like to see two different versions of a library.

http://www.infoq.com/news/2009/01/ramnivas-aop-choices

/JXInsight 5.6 extends it load-time weaving cache to now store the transformed bytecode image across application executions turning load-time weaving into binary weaving on consecutive executions. Our approach makes the switch between load-time weaving and binary weaving transparent - the first time an application is executed JXInsight will use load-time weaving the second time it uses binary weaving via the persisted transformed bytecode from the initial load-time weaving transformation. This reduces the (re)start-up time as well as the memory footprint - both which is extremely important in production environments.
/
William
Message: 1
Date: Fri, 13 Feb 2009 14:06:02 -0500
From: Dave Whittaker <dave@xxxxxxxxxx>
Subject: Re: [aspectj-users] Why are you using LTW?
To: aspectj-users@xxxxxxxxxxx

I agree with Ramnivas. As an added benefit, if you're like me, you'll see a big speed increase in your app when you move over to compile time as well since runtime weaving can be costly.

On Feb 10, 2009, at 4:36 PM, Ramnivas Laddad wrote:

Most use LTW as an easy way to get started with AspectJ (no build
script modifications). A few also need to weave into container classes
and LTW seems easier than performing offline binary weaving and
replacing original jars with woven jars. If that is not required, many
eventually move over to compile-time weaving.

I wouldn't worry about "official" compiler issue, since in the end the
VM sees essentially the same byte code regardless of the utilized
weaving mechanism.

-Ramnivas


------------------------------------------------------------------------

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


--
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/



Back to the top