-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
formattedMessage cache is obsolete when size > 100 #104
Comments
I looked into it a bit more, the cache does help a lot:
The 2 initial logs are during startup. When the cache is hit it takes almost no time. If all items get a miss the time it takes will be noticeable. File used:
|
Do you think we need to make the cache bigger? or change how it's working? |
@yoavbls I think it needs to be changed to be smarter about cache hits and misses. Although we could also just increase the cache size and see if people with performance issues notice a change. |
Looking into the performance problems I checked o see what happens when a file has more diagnostics than the cache size allows for (currently 100).
I found that the part:
pretty-ts-errors/src/extension.ts
Lines 61 to 64 in 2531440
does not work as intended, since the first diagnostic that is being checked for will not be part of the cache. Then the newly formattedMessage will replace an entry in the cache, causing the next diagnostic to also be a cache miss.
Example file
I doubt this is the cause of the performance issue, but it is definitely not helping. I wonder how much the cache actually helps at all, as far as I can tell the formatting is not expensive so far.
The text was updated successfully, but these errors were encountered: