On 08.05.2008 11:53, Bruce Atherton wrote:

My only comment is that I think it would be good to allow the initial buffer size to be configurable. If you know the bulk of your responses are greater than 32K, then performing the ramp-up from 8K every time would be a waste of resources. For another web site, if most responses were smaller than 6K then an 8K buffer would be perfect. Allowing someone to tweak that based on their situation seems useful to me.

Not critical though, if it is hard to do. Allowing the buffer to scale is the important thing.

I think this is rather hard to do. The place where we instantiate the BufferedOutputStreams (both java.io and o.a.c.util) is AbstractEnvironment.getOutputStream(int bufferSize). So in order to pass a second buffer size argument to the BufferedOutputStream constructor we need to have it available there. One option would be to add it to getOutputStream() - which is an interface change and not really nice.

The second option would be to pass it to the Environment instance. Since environments can be wrapped it needs again an interface change (but just adding a method, which is much better). And you have to look where environments are instantiated, e.g. HttpServletEnvironment in CocoonServlet. From what I see from a quick look only potential way to provide a configuration would be as servlet init parameter. That makes it two different places to configure these two different buffer sizes - not very intuitive.

Joerg

Reply via email to