db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahler Thomas <thomas.mah...@itellium.com>
Subject RE: minor performance improvement in CollectionProxy
Date Tue, 17 Jun 2003 12:34:47 GMT
sounds good!

> -----Original Message-----
> From: oliver.matz@ppi.de [mailto:oliver.matz@ppi.de]
> Sent: Tuesday, June 17, 2003 12:41 PM
> To: ojb-dev@db.apache.org
> Subject: minor performance improvement in CollectionProxy
> 
> 
> Hello,
> 
> I would like to propose to replace the follwing 
> lines 138-142 in CollectionProxy
> 
> 	Collection result = (Collection) 
> getCollectionClass().newInstance();
> 	if (!isEmpty())
> 	{
> 		result =
> (Collection)getBroker().getCollectionByQuery(getCollectionClas
> s(),getQuery()
> );
> 	}
> 
> by 
> 	Collection result;
>       if (m_size != 0)
>       {
>         result =
> (Collection)getBroker().getCollectionByQuery(getCollectionClas
> s(),getQuery()
> );
>       }
>       else
>       {
>         result = (Collection) getCollectionClass().newInstance();
>       }
> 
> If the collection size has not been loaded before,
> (i.e., when m_size = -1), this saves 
> the instantiation/garbarge collection of an empty collection and one
> jdbc call for the collection size (inside isEmpty()).
> 
> What do you think?
> 
> Olli
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


Mime
View raw message