I have some small performance improvements in the pipe for DynamicURI to avoid too many objects creation.
I noticed that when profiling my webapp, it is not rare to have more than 40/50 uris (between contenturi, templatelink...) per page and it adds quite some consequent and unecessary overhead. (lots of objects created per call) It can be reduced consequently with the following: 1) pre-allocate reasonable size to the buffer in toString() (say 128 bytes for an uri) 2) change the renderQueryString and renderPathInfo to receive a StringBuffer and append the pairs to it. 3) refactor the renderQueryString and renderPathInfo into a renderPairs since it is the same code with different separators. 4) use ArrayList instead of Vector and remove hasQueryData and hasPathInfo. isEmpty() is good and self explanatory enough IMHO. No need to duplicate and it does not add such overhead. 5) Change getA() to use better StringBuffer allocation. (and remove the ECS use in T2.2 which also adds consequent overhead. ) - Done in T3 except for proper allocation. 6) Add a isReservedParameter(String ) method to allow easier customization for the add(int, ParameterParser) for subclasses. It can be done in T2.2 and T3 code. Less aggressively on T2.2 code because of backward compatibility problems. (we can still keep the Vector and hasxxxx for example and deprecate the renderXXX in favor of the others). Thoughts ? Stephane -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
