RE: Design Question in TomCat 5

2004-01-29 Thread Shapira, Yoav

Howdy,

But from Sun's web page, it said do not pool objects. So my question is
Is
it a good idea to do object pooling for the sake of performance
improvement?

Do not pool objects is an overly general tip.  If objects are
expensive to create, pooling them is a classical way to enhance
performance of a system.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Design Question in TomCat 5

2004-01-29 Thread Filip Hanik
As Yoav said, pooling is a question of how expensive it is to create them.

Also to add in there are many more factors to consider

1. how expensive is it to GC in a non pooled environment
2. how expensive is it to synchronize to keep your pool thread safe

so it all becomes a question of the scenario that you have, it is not
general

Filip


- Original Message -
From: Shapira, Yoav [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, January 29, 2004 11:11 AM
Subject: RE: Design Question in TomCat 5



Howdy,

But from Sun's web page, it said do not pool objects. So my question is
Is
it a good idea to do object pooling for the sake of performance
improvement?

Do not pool objects is an overly general tip.  If objects are
expensive to create, pooling them is a classical way to enhance
performance of a system.

Yoav Shapira



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Design Question in TomCat 5

2004-01-29 Thread nishant kumar
hi,
i too wondered about this. i agree with you that Sun's suggestion of
not using object pooling should not be applied in all cases. so let me
point out a specific case. i guess Request and response objects are
recycled and in the recycle method, all variables are cleared, if they
are collection objects, or are set to null. this means you anyway end up
creating all the objects again. you end up saving some memory allocation
overhead of creating the request object and may be some collection
objects. But this is at the cost of doing all the stuff in the recycle
method and the added complexity in the code.
i guess this is what the sun's site speaks about that memory allocation
is no more costly, especially in the newer jvms(say 1.4.2). 
so my specific question is that do we need to recycle request and
response objects when using jdk1.4.2?

thanks,
nishant.


On Fri, 2004-01-30 at 00:53, Filip Hanik wrote:
 As Yoav said, pooling is a question of how expensive it is to create them.
 
 Also to add in there are many more factors to consider
 
 1. how expensive is it to GC in a non pooled environment
 2. how expensive is it to synchronize to keep your pool thread safe
 
 so it all becomes a question of the scenario that you have, it is not
 general
 
 Filip
 
 
 - Original Message -
 From: Shapira, Yoav [EMAIL PROTECTED]
 To: Tomcat Developers List [EMAIL PROTECTED]
 Sent: Thursday, January 29, 2004 11:11 AM
 Subject: RE: Design Question in TomCat 5
 
 
 
 Howdy,
 
 But from Sun's web page, it said do not pool objects. So my question is
 Is
 it a good idea to do object pooling for the sake of performance
 improvement?
 
 Do not pool objects is an overly general tip.  If objects are
 expensive to create, pooling them is a classical way to enhance
 performance of a system.
 
 Yoav Shapira
 
 
 
 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential, proprietary
 and/or privileged.  This e-mail is intended only for the individual(s) to
 whom it is addressed, and may not be saved, copied, printed, disclosed or
 used by anyone else.  If you are not the(an) intended recipient, please
 immediately delete this e-mail from your computer system and notify the
 sender.  Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]