velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fahrmeyer" <thomas.fahrme...@einsurance.de>
Subject RE: Why have the caching stuff been removed ?
Date Tue, 13 Feb 2001 14:31:22 GMT
A code project seems to be very usefull. I think the caching stuff is so
common that nearly every project can benefits from this piece of code. I'll
move it into my own source tree until such a project was etablished.

I'm going to modify the code anyway - a little performance improvement.

If the GlobalCache.get(key) is called and the the key is not present a
NullPointerException comes up, because the content of the CachedObject is
null. That forces to call contains(key) before, what is an unnecessary time
consuming operation on a large cache. ;(

Why can't "get(key)" catches the content==null problem and just returns null
as result. So, I can call contains(key) only if I really want to know
whether the object is inside. The method get(key) is faster, because it
access a HashMap(table) instead of iterating over all keys to determine
whether the key is there or not.

Just a suggestion
Thomas


-----Original Message-----
From: Geir Magnusson Jr. [mailto:gmj@xyris.com]
Sent: Tuesday, February 13, 2001 2:59 PM
To: velocity-user@jakarta.apache.org
Subject: RE: Why have the caching stuff been removed ?


If you wish.  It is APL'd code.
We removed it from the Velocity distribution as it wasn't being used, and we
are trying to pare down both the size of the distro, as well as eliminating
any support obligations implied by code in the source tree.
There is ongoing preliminary discussion of a utility code project /
repository, and that code (or something like it...)  may be moved there (or
not.)
Summary : sure, but don't expect the code to be supported.  No warranties
expressed or implied :)
geir


> -----Original Message-----
> From: Thomas Fahrmeyer [mailto:thomas.fahrmeyer@einsurance.de]
> Sent: Tuesday, February 13, 2001 8:56 AM
> To: Velocity-User
> Subject: Why have the caching stuff been removed ?
>
>
> Hi,
>
> I'm using the GlobalCache and I find it very usefull. Should
> I extract the
> caching stuff and put it into my own source tree ?
>
> bye
> Thomas
>


Mime
View raw message