Fixes a bug in the varTracking logic that was re-calculating the globals too frequently (for each file for each scope). Since the globals are shared across every file in that scope, we can lift that calculation.
Here's some pseudocode of what changed.
Before:
for (const scope of scopes) {
for (const file of scope.files) {
const globals = getAllGlobalNamesInScope(scope);
validateFile(scope, file, globals);
}
}
After:
for (const scope of scopes) {
const globals = getAllGlobalNamesInScope(scope);
for (const file of scope.files) {
validateFile(scope, file, globals);
}
}
This shaved off 1,300ms from the validation cycle of a large internal project
Fixes a bug in the varTracking logic that was re-calculating the globals too frequently (for each file for each scope). Since the globals are shared across every file in that scope, we can lift that calculation.
Here's some pseudocode of what changed. Before:
After:
This shaved off 1,300ms from the validation cycle of a large internal project
Before:
After: