> Mark, > > On 10/18/19 12:22, ma...@apache.org wrote: >> This is an automated email from the ASF dual-hosted git >> repository. > >> markt pushed a commit to branch master in repository >> https://gitbox.apache.org/repos/asf/tomcat.git > > >> The following commit(s) were added to refs/heads/master by this >> push: new b8cc215 Minor optimisation - add new line to access log >> message outside the sync b8cc215 is described below > > Doesn't this perform a string-mutation instead of a stream-append?
No. Both message and write are writers. > Or is it more critical to hold the lock for as short a period as possible? I was looking for hot-spots, making sure the header parsing changes weren't having a measurable impact. The header parsing never even appeared in the results. But the AccessLog did. The new code is marginally faster but the hot spots were dominated by I/O (on localhost) and profiler calls. The % of call time spent waiting for that sync dropped from ~13% to ~12%. I don't trust the numbers from the profiler as the test was well into the realm where the profiler has a significant impact on the figures but I do trust the direction of travel (downwards). The AccessLog is still a bottleneck. I don't see any easy way to remove that without significantly increasing the extent to which entries are added out of chronological order. Mark > > -chris > >> commit b8cc21574938dc8f46b88396de0694e1ce7aa0a7 Author: Mark Thomas >> <ma...@apache.org> AuthorDate: Fri Oct 18 17:03:47 2019 +0100 > >> Minor optimisation - add new line to access log message outside the >> sync --- java/org/apache/catalina/valves/AccessLogValve.java | 2 >> +- 1 file changed, 1 insertion(+), 1 deletion(-) > >> diff --git a/java/org/apache/catalina/valves/AccessLogValve.java >> b/java/org/apache/catalina/valves/AccessLogValve.java index >> fe2943e..b133e10 100644 --- >> a/java/org/apache/catalina/valves/AccessLogValve.java +++ >> b/java/org/apache/catalina/valves/AccessLogValve.java @@ -610,10 >> +610,10 @@ public class AccessLogValve extends >> AbstractAccessLogValve { > >> // Log this message try { + >> message.write(System.lineSeparator()); synchronized(this) { if >> (writer != null) { message.writeTo(writer); - >> writer.println(""); if (!buffered) { writer.flush(); } > > >> --------------------------------------------------------------------- > > > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: dev-h...@tomcat.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org