commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Smith" <msm...@dorado.com>
Subject Re: [BeanUtils] MethodUtils caching
Date Wed, 18 Dec 2002 00:44:43 GMT
Robert -

This statement confused me at first, because the first thing I tried was
updating from BeanUtils1.3 to BeanUtils1.5. I did not find any difference in
the performance characteristics. Both contain a call to Class.getMethods(),
which my profiler indicated was where most of the work was being done.

However, I'm currently running under JDK1.3. I looked at the source for
JDK1.4, and Class does indeed now cache a bunch of calls, including
getMethods(). Updating to JDK1.4 had a significant impact on the performance
characteristics for this particular call.

As usually works out, however, doing no work at all is faster than doing
some work. I found that my personal implementation of caching the result of
of getAccessibleMethod() improved things further still. On the particular
data set I'm running on, the normalized times were:
JDK1.3: 1.0
JDK 1.4: 0.85
Cached: 0.66

It's possible that for most people it doesn't make a difference, however. My
data is "perversely leafy", which makes it call these digester rules many
times.

-Matt

----- Original Message -----
From: "robert burrell donkin" <robertburrelldonkin@blueyonder.co.uk>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
Sent: Tuesday, December 17, 2002 10:38 AM
Subject: Re: [BeanUtils] MethodUtils caching


are you using the latest beanutils release?

the performance of this code was significantly improved for the last
release.

- robert

On Tuesday, December 17, 2002, at 08:03 AM, Matt Smith wrote:

> I'm looking for a way to speed up some of my uses of Digester, and
> SetNextRule heavily relies upon MethodUtils.invokeMethod. What I've seen
> is that most of the time spent in getMatchingAccessibleMethod, and in
> particular in Class.getMethods(). Most of this is wasted work, since it's
> pretty much always the same class and paramType list being used for any
> particular instance of SetNextRule. So I'd like to cache the results of
> getMatchingAccessibleMethod, but it's private, making it a cut & paste
> job to do so. I can do that if I have to, but I was wondering if there is
> any code out there that is currently doing this type of caching already,
> of if you guys can tell me a better way to deal with this. I'd like to
> continue to benefit from updates to BeanUtils without re-copying code
> every time.
>
> -Matt


--
To unsubscribe, e-mail:
<mailto:commons-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-user-help@jakarta.apache.org>


Mime
View raw message