XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • tools
    • b96
    • Not verified

      Performance is improved by reducing operator overloading because of this:

      Method findMethodInScope in Resolve with this definition:

          Symbol findMethodInScope(Env<AttrContext> env,
                  Type site,
                  Name name,
                  List<Type> argtypes,
                  List<Type> typeargtypes,
                  Scope sc,
                  Symbol bestSoFar,
                  boolean allowBoxing,
                  boolean useVarargs,
                  boolean operator,
                  boolean abstractok) {
              for (Symbol s : sc.getElementsByName(name, new LookupFilter(abstractok))) {
                  bestSoFar = selectBest(env, site, argtypes, typeargtypes, s,
                          bestSoFar, allowBoxing, useVarargs, operator);
              }
              return bestSoFar;
          }

      calls a expensive method selectBest. If an operator is heavily overloaded then the sc.getElementsByName call will return a lot of nonsense hits and this will imply a useless call to selectBest thus producing a slowdown.

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: