-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to benchmarking to make v1 work with v0 and a new target that…
… exemplifies symbol caching
- Loading branch information
1 parent
2403a57
commit 6a1fc98
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module.exports = async (suite, name, brighterscript, projectPath, options) => { | ||
const { ProgramBuilder } = brighterscript; | ||
|
||
const builder = new ProgramBuilder(); | ||
//run the first run so we we can focus the test on validate | ||
await builder.run({ | ||
cwd: projectPath, | ||
createPackage: false, | ||
copyToStaging: false, | ||
//disable diagnostic reporting (they still get collected) | ||
diagnosticFilters: ['**/*'], | ||
logLevel: 'error' | ||
}); | ||
const files = Object.values(builder.program.files).filter(x => ['.brs', '.bs'].includes(x.extension)); | ||
if (files.length === 0) { | ||
console.log('[hover-brs] No brs|bs files found in program'); | ||
return; | ||
} | ||
|
||
suite.add(name, () => { | ||
for (const file of files) { | ||
// Hover every 20th token | ||
for (let i = 0; i < file.parser.tokens.length; i += 20) { | ||
const token = file.parser.tokens[i]; | ||
file.getHover(token.range.end); | ||
} | ||
} | ||
}, options); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters