mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
36d877be4a
VScode will typically send a `textDocument/semanticTokens/full` request followed by `textDocument/semanticTokens/range`, and occassionally request semantic tokens even when we know nothing has changed. Semantic tokens also get refreshed on each change. Computing semantic tokens is relatively heavy in TSC, so we should avoid it as much as possible. Caches the semantic tokens for open documents, to avoid making TSC do unnecessary work. Results in a noticeable improvement in local benchmarking before: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 383ms) - Big Document/Several Edits (5 runs, mean: 1079ms) - Find/Replace (10 runs, mean: 59ms) - Code Lens (10 runs, mean: 440ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 9921ms) <- End benchmarking lsp ``` after: ``` Starting Deno benchmark -> Start benchmarking lsp - Simple Startup/Shutdown (10 runs, mean: 395ms) - Big Document/Several Edits (5 runs, mean: 1024ms) - Find/Replace (10 runs, mean: 56ms) - Code Lens (10 runs, mean: 438ms) - deco-cx/apps Multiple Edits + Navigation (5 runs, mean: 8927ms) <- End benchmarking lsp ``` |
||
---|---|---|
.. | ||
args | ||
bench | ||
cache | ||
js | ||
lsp | ||
napi | ||
npm | ||
ops | ||
schemas | ||
standalone | ||
tools | ||
tsc | ||
util | ||
auth_tokens.rs | ||
build.rs | ||
Cargo.toml | ||
cdp.rs | ||
deno.ico | ||
emit.rs | ||
entitlements.plist | ||
errors.rs | ||
factory.rs | ||
file_fetcher.rs | ||
graph_util.rs | ||
http_util.rs | ||
integration_tests_runner.rs | ||
js.rs | ||
jsr.rs | ||
main.rs | ||
mainrt.rs | ||
module_loader.rs | ||
node.rs | ||
README.md | ||
resolver.rs | ||
version.rs | ||
worker.rs |