Add lookup tables to DiagnosticsManager to speed up diagnostic clearing#1411
Conversation
…e,tag,segment,etc, instead of looping all diagnostics
|
Hey there! I just built a new temporary npm package based on f77c753. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250213160536.tgz |
|
Hey there! I just built a new temporary npm package based on 55e91ba. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250214142216.tgz |
|
Hey there! I just built a new temporary npm package based on 2be68e9. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250214154143.tgz |
|
Hey there! I just built a new temporary npm package based on dd4c33b. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250220174529.tgz |
|
Hey there! I just built a new temporary npm package based on be504ae. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250220181209.tgz |
|
|
||
| clonedNsContainer.symbolTable.mergeSymbolTable(nsContainer.symbolTable); | ||
| namespaceLookup.set(lowerNamespaceName, clonedNsContainer); | ||
| } else { |
There was a problem hiding this comment.
eliminates a bunch of empty/useless maps
|
Hey there! I just built a new temporary npm package based on c072b43. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250220181710.tgz |
| } | ||
| this.linkSymbolTableDisposables = []; | ||
|
|
||
| this.cache.delete('namespaceLookup'); |
There was a problem hiding this comment.
The namespaceLookup was stored in the cache, and not needed outside of when the scope was linked... deleting it here makes sense
|
Hey there! I just built a new temporary npm package based on 1ba732c. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250220200213.tgz |
|
Hey there! I just built a new temporary npm package based on 18dd8db. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250222234304.tgz |
|
Hey there! I just built a new temporary npm package based on 6b46ca8. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250224133136.tgz |
|
Hey there! I just built a new temporary npm package based on f5af66a. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250224180010.tgz |
|
Hey there! I just built a new temporary npm package based on 87502c2. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250224194448.tgz |
|
Hey there! I just built a new temporary npm package based on 9f29569. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.44-scope-validation-performance.20250224203107.tgz |

TBH, I'm not sure if this will speed up validation. However, there are many times in the validation process when the Diagnostic Manager needs to clear all diagnostics based on scope, file, tag, etc. Previously, this was done by looping all diagnostics, so if there are lots, it probably went slower and slower. This change should make it much more quick to find the diagnostics that need to be cleared.
Also added some more fine-grained Scope Validation metrics that are printed out with log-level debug: