add logger and performance measurement#138
Closed
kevinramharak wants to merge 5 commits into
Closed
Conversation
kevinramharak
force-pushed
the
feature/add-logging-and-performance-measurement
branch
from
October 13, 2025 09:37
24d2aca to
153e11c
Compare
kevinramharak
marked this pull request as draft
October 13, 2025 11:53
kevinramharak
added a commit
that referenced
this pull request
Oct 19, 2025
Collaborator
Author
|
Closed as superseded by #151 |
kevinramharak
deleted the
feature/add-logging-and-performance-measurement
branch
November 4, 2025 22:31
kevinramharak
added a commit
that referenced
this pull request
Jan 26, 2026
* reimplement #138 * document diagnostics.ts and the store with some comments and links * sort imports * improve logger; add logging to copyError command * split revealSelection into functions; add input validation; add logging; * refactor the openMarkdownPreview as a seperate command; increase security of markdown preview provider; add logging on invalid input; * add generic logging to commands * add comments * add strict to uri parsing * add logging to critical paths; add some dev ux to log output; * fix naming * move logging disposable registering to register fn * add instructions to export the logs and add them to github issues * add details element to github issue template * Apply suggestions from code review - fix link to `vscode-logs.md` - fix `pre` and `code` opening tag in issue template Co-authored-by: Yoav Balasiano <yoavbls@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have had this idea for a long time, finally got around to implementing it.
This implements:
LogOutputChannelnamedPretty TypeScript Errorsmeasuremethod for the logger to measure the execution time of certain code pathsuriStoretoMapinstead of aRecord.changes.filter.forEach(() => items.push())to a singlereduceto avoid the double iterationcacheanduriStorewhen the extension is deactivated to clean up resources.100to1000Notes:
tracelog level, VSCode has to be told to set its log level totraceto collect all logs. Since most of these measurements are < 1ms they are very unlikely to be the cause of our performance issues.onDidChangeDiagnosticsfires a lot, most of the time with0uri's. No idea why vscode triggers the event so often, when nothing actually changed. The execution time is < 1ms so its not the cause of the issue.onDidChangeDiagnosticswith theuriof the focussed file very often. Even if there are no difference in diagnostics. This could be on the side of the TS language server where they alter the diagnostics collection, even if the collection stays identical. The execution time is < 1ms so this is also not the cause of the issue.We may have to also calldisposeon the logger, but since we want to preserve the logs in case of a crash or when the extension hangs, I'm not sure if that will also wipe the log.CACHE_SIZE_MAXandsupportedDiagnosticSources. This could be useful to recommend to users, and see if that fixes their performance issues.Some screenshots:
