Describe the bug
On every operation on a Rascal search path, the complete search path is rebuilt in RascalSearchPath::collect:
|
public List<ISourceLocation> collect() { |
|
List<ISourceLocation> paths = new LinkedList<ISourceLocation>(); |
|
for (IRascalSearchPathContributor c : contributors) { |
|
c.contributePaths(paths); |
|
} |
|
|
|
return paths; |
|
} |
The path cannot be simply built once, because the search path can be amended after the evaluator has been initialized. However, in a typical scenario, the search path is set up before any operations on the search path. Hence, the result of collect() could be re-used and only invalidated on changes to the search path, to greatly reduce the number of collections being built.
Describe the bug
On every operation on a Rascal search path, the complete search path is rebuilt in
RascalSearchPath::collect:rascal/src/org/rascalmpl/interpreter/load/RascalSearchPath.java
Lines 106 to 113 in 16abf95
The path cannot be simply built once, because the search path can be amended after the evaluator has been initialized. However, in a typical scenario, the search path is set up before any operations on the search path. Hence, the result of
collect()could be re-used and only invalidated on changes to the search path, to greatly reduce the number of collections being built.