-
Sub-task
-
Resolution: Fixed
-
P3
-
8
-
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.
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.