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
Large file under git control encoding guess can freeze the editor #87205
Comments
@ziggi great analysis, wanna report it to jschardet maybe? |
I'm not 100% sure what the problem is in jschardet. The problem may be in vscode only. |
@ziggi looks like jschardet to me. We are simply calling this method: vscode/src/vs/base/node/encoding.ts Line 215 in b6ae21e
|
Ok, done: aadsm/jschardet#53 |
@creative-acr do you have |
@ziggi to clarify, you only see this with large files that are under git control? |
@bpasero yes |
I can reproduce and it looks like the dirty diff decorator is triggering this (probably ever since we moved to git-fs recently). Though I cannot explain why this performance issue does not show up when just opening the editor where we also guess the encoding. Maybe the diff decorator is not as optimized as the code editor model that reads the file in chunks and reads the file entirely? @joaomoreno steps to reproduce: aadsm/jschardet#53 (comment) |
I pushed a fix that will limit the buffer for encoding guessing to 65kb. The dirty diff decorator was passing the entire buffer. Filed #88119 as follow up. |
Steps to Reproduce:
Windows 1251
encoding and VS Codesettings.json
should contains"files.autoGuessEncoding": true,
.Does this issue occur when all extensions are disabled?: Yes
It looks like the problem is in jschardet, it was updated from 1.6.0 to 2.1.1.
CPU-20191218T010956.cpuprofile.txt
Profile-20191218T010523.json.txt
The text was updated successfully, but these errors were encountered: