RemoLiechti commented on code in PR #55: URL: https://github.com/apache/sling-org-apache-sling-engine/pull/55#discussion_r1959478237
########## src/test/java/org/apache/sling/engine/impl/SlingHttpServletResponseImplTest.java: ########## @@ -85,6 +86,72 @@ public class SlingHttpServletResponseImplTest { "4749 LOG Adding bindings took 4 microseconds" }; + @Test + public void testRecursiveCalls() { + String[] recursivePartStrings = { + "4722 TIMER_START{/libs/slingshot/Component/head.html.jsp#1}", + "3757 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter", + "4859 TIMER_END{135,/libs/slingshot/Component/head.html.jsp#1}", + "3765 LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter", + "2678 TIMER_START{ServletResolution}", + "2683 TIMER_START{resolveServlet(/content/slingshot)}", + "2678 TIMER_START{ServletResolution}", + "2683 TIMER_START{resolveServlet(/content/slingshot)}", + "3724 TIMER_END{1040,resolveServlet(/content/slingshot)} Using servlet /libs/slingshot/Home/html.jsp", + "3727 TIMER_END{1047,ServletResolution} URI=/content/slingshot.html handled by Servlet=/libs/slingshot/Home/html.jsp", + "3724 TIMER_END{1040,resolveServlet(/content/slingshot)} Using servlet /libs/slingshot/Home/html.jsp", + "3727 TIMER_END{1047,ServletResolution} URI=/content/slingshot.html handled by Servlet=/libs/slingshot/Home/html.jsp", + "3774 LOG Applying Componentfilters", + "3797 TIMER_START{/libs/slingshot/Home/html.jsp#0}", + "3946 LOG Adding bindings took 18 microseconds", + "4405 LOG Including resource JcrNodeResource, type=slingshot/Home, superType=null, path=/content/slingshot (SlingRequestPathInfo: path='/content/slingshot', selectorString='head', extension='html', suffix='null')", + "4414 TIMER_START{resolveServlet(/content/slingshot)}", + "4670 TIMER_END{253,resolveServlet(/content/slingshot)} Using servlet /libs/slingshot/Component/head.html.jsp", + "4673 LOG Applying Includefilters" + }; + + String[] concatenatedArray = Stream.concat(Arrays.stream(logMessages), Arrays.stream(recursivePartStrings)) + .toArray(String[]::new); + for (int i = 0; i < 50; i++) { Review Comment: arrays have direct memory access and no overhead in managing size and structure compared to lists (even arraylist), so it is faster. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org