Re: [PATCH] performance improvement for apr_pstrcat

2001-09-28 Thread Ian Holsman
Cliff Woolley wrote: On Wed, 26 Sep 2001, Brian Pane wrote: apr_pstrcat does two passes through its args: one to compute the length, a second to do the copying. This patch adds a buffer to save the lengths of the first 6 args so that the second pass doesn't need to another strlen on them. (If yo

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Cliff Woolley
On Wed, 26 Sep 2001, Brian Pane wrote: > apr_pstrcat does two passes through its args: one to compute the > length, a second to do the copying. This patch adds a buffer to > save the lengths of the first 6 args so that the second pass > doesn't need to another strlen on them. (If you pass in mor

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
Ryan Bloom wrote: On Wednesday 26 September 2001 06:57 pm, Brian Pane wrote: Ryan Bloom wrote: [...] +static const int MAX_SAVED_LENGTHS = 6; Why is this a static const istead of a #define? So that its scope will be limited to the enclosing function But why is that a good thing? This should be

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Ryan Bloom
On Wednesday 26 September 2001 06:57 pm, Brian Pane wrote: > Ryan Bloom wrote: > > [...] > > >+static const int MAX_SAVED_LENGTHS = 6; > > > >Why is this a static const istead of a #define? > > So that its scope will be limited to the enclosing function But why is that a good thing? This shou

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
Ryan Bloom wrote: [...] +static const int MAX_SAVED_LENGTHS = 6; Why is this a static const istead of a #define? So that its scope will be limited to the enclosing function --Brian

Re: [PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Ryan Bloom
On Wednesday 26 September 2001 06:34 pm, Brian Pane wrote: > I instrumented apr_pstrcat and found that, in Apache 2.0, the number of > strings it's asked to concatenate is 6 or less 99+% of the time. > > apr_pstrcat does two passes through its args: one to compute the > length, a second to do the c

[PATCH] performance improvement for apr_pstrcat

2001-09-27 Thread Brian Pane
I instrumented apr_pstrcat and found that, in Apache 2.0, the number of strings it's asked to concatenate is 6 or less 99+% of the time. apr_pstrcat does two passes through its args: one to compute the length, a second to do the copying. This patch adds a buffer to save the lengths of the first 6