Severe compiler perf problem

Help
2004-11-19
2012-10-08
  • Francis Upton

    Francis Upton - 2004-11-19

    This started happening when I upgraded to b8.1.1. I have been compiling the same (several hundred line) XQuery programs in previous versions with no problems. With the new version the time to compile a query has grown from a few second to tens of minutes.

    I tracked down the problem to this code:

    public int allocateLocationId(String module, int lineNumber) {
        if (module == null) {
            // the module has no base URI
            module = "module-" + numberOfModules + " (no base URI)";
        }
        int mod = -1;
        for (int m=numberOfModules-1; m>=0; m--) {
            if (modules[m].equals(module)) {
                mod = m;
            }
        }
    

    In my case, I don't specify a base-URI, so it appears to be generating 10s of thousands of modules (I interrupted the code at module number 24K), and then doing a linear search for those. I will work around this by specifying a systemId in the environment, but this probably should be fixed for the next unsuspecting person.

    Thanks,

    Francis

     
    • Michael Kay

      Michael Kay - 2004-11-19

      Thanks for reporting this, will fix.

      Michael Kay

       
    • Michael Kay

      Michael Kay - 2004-11-20

      Now fixed. I will in future use the same module ID whenever the systemId of the module is unknown.

      Michael Kay

       

Log in to post a comment.