Arvind Srinivasan wrote:
> 
> I think the performance related change that you made to StandardPipeline can
> be improved upon in that it can avoid using a HashMap to store/retrieve the
> pipeline stage and instead simply store/retrieve it from an integer variable
> in the RequestBase class. Since this codepath (StandardPipeline.invokeNext)
> is executed many times per request, replacing the request.getNote() call
> with something like request.getPipelineStage() will benefit performance.
> I've attached a patch that implements this suggestion.
> 

 The obvious implementation is to have have ValveContext hold
the index.

 That's how I assumed it worked the first time I
saw the Pipeline, Valve and ValveContext classes. I was suprised
to see a ThreadLocal. Using ValveContext has the appropriate
threading semantics, and it avoids hiding the index in a
"mystery attribute" in the Request. And, (although none of this
will result in a measurable performance gain) using 
ValveContext to hold the index should be faster, since it
avoids a hashtable lookup.

 Using a Request note is much like using a global variable:
it's  hidden state. Long term that's bad, for obvious
reasons.


-- 
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

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

Reply via email to