<div dir="ltr">Hi,<div><br></div><div>today I noticed the following bottleneck in Yanel's implementation:</div><div><br></div><div>for each request, the resource gets instantiated. and for each request, the resource config XML gets parsed. During this parsing, obviously something requires a Java System Property to be read, and this access obviously gets synchronized, which is VERY bad for concurrency.</div><div><br></div><div>We have about 90 requests per second at peak time, and this is now our next bottleneck (many others have been eliminated in the past).</div><div><br></div><div>Here is the stack trace. Any idea, what exactly gets parsed here and why?</div><div>I will optimize this code in my own Yanel branch and get rid of it (e.g. permanent caching of resource config would help a lot).</div><div><br></div><div><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;margin-top:0px;padding:16px;overflow:auto;line-height:1.45;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46);margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;padding:0px;margin:0px;background:initial;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">"http-bio-443-exec-6766" #10541 daemon prio=5 os_prio=0 tid=0x00007f970d2bb800 nid=0x6ccf waiting for monitor entry [0x00007f9590c4c000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.util.Hashtable.get(Hashtable.java:362)
        - waiting to lock <0x00000001806b31b0> (a java.util.Properties)
        at java.util.Properties.getProperty(Properties.java:969)
        at java.lang.System.getProperty(System.java:720)
        at org.apache.xerces.parsers.SecuritySupport$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.xerces.parsers.SecuritySupport.getSystemProperty(Unknown Source)
        at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
        at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
        at org.wyona.yanel.core.util.ConfigurationUtil.getCustomConfiguration(ConfigurationUtil.java:170)
        at org.wyona.yanel.core.ResourceConfiguration.load(ResourceConfiguration.java:194)
        at org.wyona.yanel.core.ResourceConfiguration.<init>(ResourceConfiguration.java:69)
        at org.wyona.yanel.core.ResourceTypeMatcherV1ImplV2.getResourceConfiguration(ResourceTypeMatcherV1ImplV2.java:66)
        at org.wyona.yanel.core.ResourceManager.getResource(ResourceManager.java:138)
        at org.wyona.yanel.servlet.YanelServlet.getResource(YanelServlet.java:1108)
        at org.wyona.yanel.servlet.YanelServlet.getContent(YanelServlet.java:608)
        at org.wyona.yanel.servlet.YanelServlet.doGet(YanelServlet.java:530)
        at org.wyona.yanel.servlet.YanelServlet.service(YanelServlet.java:414)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)</code></pre></div></div>