Skip to content
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

Slow when editing a file with very long lines #55605

Open
svdamani opened this issue Aug 1, 2018 · 11 comments
Open

Slow when editing a file with very long lines #55605

svdamani opened this issue Aug 1, 2018 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues tokenization Text tokenization verification-found Issue verification failed
Milestone

Comments

@svdamani
Copy link

svdamani commented Aug 1, 2018

Issue Type: Performance Issue

Steps to reproduce

  1. Open any text file with longer lines (more than 10k characters).
  2. Try to edit the line (remove or add characters in between).

Observations

  • The cursor movement is extremely slow and character updates take place after a long time.
  • The same behaviour is observed when Word Wrap is on.
  • Gives a warning sometimes

Tokenization is skipped for lines longer than 20k characters for performance reasons.

System Information

VS Code version: Code 1.25.1 (1dfc5e5, 2018-07-11T15:33:29.235Z)
OS version: Darwin x64 17.7.0

@vscodebot
Copy link

vscodebot bot commented Aug 1, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-wrapping Editor line wrapping issues labels Aug 1, 2018
@alexdima alexdima removed the editor-wrapping Editor line wrapping issues label Aug 2, 2018
@alexdima
Copy link
Member

alexdima commented Aug 3, 2018

@svdamani What file type are you using? Can you give an example text that reproduces this consistently? What is your use case for having >10k char lines in source code?

@svdamani
Copy link
Author

svdamani commented Aug 3, 2018

@alexandrudima Take any minified JSON file for example. When you try to edit it, it is slow even when file is not tokenized or word wrap is enabled. (A minified file can easily have more than 10k chars in single line)

@alexdima
Copy link
Member

alexdima commented Aug 3, 2018

@svdamani I cannot reproduce. I have tried with the following JSON file, that meets your criteria (a line with 25044 characters):

(just rename from .txt to .json)
test.json.txt

Typing does not take a long time for me:
kapture 2018-08-03 at 14 09 08

@alexdima alexdima added the info-needed Issue requires more information from poster label Aug 3, 2018
@svdamani
Copy link
Author

svdamani commented Aug 5, 2018

@alexandrudima Yeah, it works fine as JSON. If you place this JSON in an HTML file as a JS object, you could reproduce this. For instance (try to edit the line below in HTML Language mode)

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <script>
        var data = {"request":[24],"response":[152,26,0,0,227,147,4,0,0,0,0,0,64,233,245,229,2,43,60,0,0,0,0,0,0,0,0,0,64,233,245,229,2,43,60,0,0,0,0,0,0,0,0,0,68,65,3,0,1,0,100,0,12,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,70,32,32,32,32,82,67,73,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,221,41,12,1,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,49,32,32,32,82,67,73,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,52,41,12,1,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,50,32,32,32,82,67,73,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,40,12,1,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,51,32,32,32,82,67,73,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,69,32,12,1,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,52,32,32,32,82,67,73,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,231,70,12,1,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,53,32,32,32,82,67,73,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,1,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,54,32,32,32,82,67,73,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,221,41,12,1,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,82,67,73,48,55,32,32,32,82,67,73,32,84,48,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,83,70,85,50,32,32,32,32,83,84,79,67,75,32,70,85,84,85,82,69,83,44,32,68,69,67,61,50,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,65,0,12,2,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,83,48,49,32,32,32,83,70,32,84,83,32,76,69,86,69,76,32,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,69,70,51,70,32,32,32,32,51,45,89,32,69,88,67,72,65,78,71,69,32,70,85,78,68,32,78,79,84,69,83,32,70,85,84,85,82,69,83,32,1,1,1,2,1,0,0,28,12,3,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,69,70,51,48,49,32,32,32,69,70,51,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,3,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,39,20,11,48,50,32,32,32,69,70,51,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,3,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,69,70,51,48,51,32,32,32,69,70,51,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,8,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,67,79,77,70,32,32,32,32,67,79,77,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,4,1,0,0,0,12,8,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,67,79,77,48,49,32,32,32,67,79,77,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,8,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,67,79,77,48,50,32,32,32,67,79,77,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,174,70,12,16,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,70,32,32,32,32,77,72,73,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,4,1,0,0,0,12,16,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,67,32,32,32,32,77,72,73,32,67,65,76,76,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,157,32,12,16,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,80,32,32,32,32,77,72,73,32,80,85,84,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,16,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,49,32,32,32,77,72,73,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,171,0,12,16,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,50,32,32,32,77,72,73,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,16,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,51,32,32,32,77,72,73,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,16,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,52,32,32,32,77,72,73,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,16,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,53,32,32,32,77,72,73,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,16,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,54,32,32,32,77,72,73,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,16,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,77,72,73,48,55,32,32,32,77,72,73,32,84,48,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,16,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,77,67,95,77,72,73,32,77,72,73,32,84,77,67,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,20,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,83,79,77,67,32,32,32,32,83,84,79,67,75,32,67,65,76,76,32,79,80,84,73,79,78,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,32,32,12,20,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,83,79,77,80,32,32,32,32,83,84,79,67,75,32,80,85,84,32,79,80,84,73,79,78,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,32,32,12,20,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,83,79,77,49,32,32,32,32,83,79,77,32,83,89,78,84,72,69,84,73,67,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,20,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,77,67,95,83,79,77,32,83,79,77,32,84,77,67,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,73,66,70,32,32,32,32,72,73,66,79,82,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,24,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,49,32,32,32,72,73,66,79,82,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,50,32,32,32,72,73,66,79,82,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,51,32,32,32,72,73,66,79,82,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,52,32,32,32,72,73,66,79,82,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,53,32,32,32,72,73,66,79,82,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,54,32,32,32,72,73,66,79,82,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,55,32,32,32,72,73,66,79,82,32,84,48,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,56,32,32,32,72,73,66,79,82,32,84,48,56,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,24,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,48,57,32,32,32,72,73,66,79,82,32,84,48,57,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,210,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,48,32,32,32,72,73,66,79,82,32,84,49,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,49,32,32,32,72,73,66,79,82,32,84,49,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,50,32,32,32,72,73,66,79,82,32,84,49,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,213,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,51,32,32,32,72,73,66,79,82,32,84,49,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,52,32,32,32,72,73,66,79,82,32,84,49,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,53,32,32,32,72,73,66,79,82,32,84,49,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,54,32,32,32,72,73,66,79,82,32,84,49,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,179,71,12,24,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,55,32,32,32,72,73,66,79,82,32,84,49,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,218,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,56,32,32,32,72,73,66,79,82,32,84,49,56,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,219,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,49,57,32,32,32,72,73,66,79,82,32,84,49,57,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,50,48,32,32,32,72,73,66,79,82,32,84,50,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,71,7,12,24,221,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,50,49,32,32,32,72,73,66,79,82,32,84,50,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,24,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,50,50,32,32,32,72,73,66,79,82,32,84,50,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,23,71,12,24,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,83,72,50,51,32,32,32,72,73,66,79,82,32,84,50,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,27,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,68,74,73,70,32,32,32,32,68,74,73,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,81,6,12,27,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,68,74,73,48,49,32,32,32,68,74,73,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,27,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,68,74,73,48,50,32,32,32,68,74,73,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,221,41,12,27,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,68,74,73,48,51,32,32,32,68,74,73,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,27,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,68,74,73,48,52,32,32,32,68,74,73,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,34,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,70,32,32,32,32,72,83,73,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,4,1,0,0,0,12,34,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,67,32,32,32,32,72,83,73,32,67,65,76,76,32,79,80,84,73,79,78,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,0,0,12,34,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,80,32,32,32,32,72,83,73,32,80,85,84,32,79,80,84,73,79,78,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,32,32,12,34,170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,73,83,84,68,32,32,32,32,73,78,68,69,88,32,83,84,82,65,68,68,76,69,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,222,142,12,34,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,73,83,84,71,32,32,32,32,73,78,68,69,88,32,83,84,82,65,78,71,76,69,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,34,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,49,32,32,32,72,83,73,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,83,80,12,34,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,50,32,32,32,72,83,73,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,34,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,51,32,32,32,72,83,73,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,84,12,34,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,52,32,32,32,72,83,73,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,34,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,53,32,32,32,72,83,73,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,179,71,12,34,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,54,32,32,32,72,83,73,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,34,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,83,73,48,55,32,32,32,72,83,73,32,84,48,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,49,32,12,34,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,77,67,95,72,83,73,32,72,83,73,32,84,77,67,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,35,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,88,72,83,67,32,32,32,32,88,72,83,32,67,65,76,76,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,35,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,88,72,83,80,32,32,32,32,88,72,83,32,80,85,84,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,37,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,72,72,83,32,32,32,32,88,72,72,32,83,80,79,84,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,2,2,2,0,0,0,0,12,37,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,88,72,72,67,32,32,32,32,88,72,72,32,67,65,76,76,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,37,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,88,72,72,80,32,32,32,32,88,72,72,32,80,85,84,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,38,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,70,32,32,32,32,72,72,73,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,4,1,0,0,0,12,38,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,67,32,32,32,32,72,72,73,32,67,65,76,76,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,0,0,12,38,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,80,32,32,32,32,72,72,73,32,80,85,84,32,79,80,84,73,79,78,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,2,82,82,12,38,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,49,32,32,32,72,72,73,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,69,69,12,38,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,50,32,32,32,72,72,73,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,38,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,51,32,32,32,72,72,73,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,38,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,52,32,32,32,72,72,73,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,38,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,53,32,32,32,72,72,73,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,78,73,12,38,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,54,32,32,32,72,72,73,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,38,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,72,72,73,48,55,32,32,32,72,72,73,32,84,48,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,78,12,38,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,84,77,67,95,72,72,73,32,72,72,73,32,84,77,67,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,32,32,12,51,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,86,79,76,70,32,32,32,32,86,79,76,32,70,85,84,85,82,69,83,46,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,32,32,12,51,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,86,79,76,48,49,32,32,32,86,79,76,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,51,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,86,79,76,48,50,32,32,32,86,79,76,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,175,70,12,60,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,70,32,32,32,32,70,88,67,32,70,85,84,85,82,69,83,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,1,1,1,2,1,0,0,0,12,60,201,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,49,32,32,32,70,88,67,32,84,48,49,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,71,6,12,60,202,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,50,32,32,32,70,88,67,32,84,48,50,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,60,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,51,32,32,32,70,88,67,32,84,48,51,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,221,41,12,60,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,52,32,32,32,70,88,67,32,84,48,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,60,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,53,32,32,32,70,88,67,32,84,48,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0,12,60,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,70,88,67,48,54,32,32,32,70,88,67,32,84,48,54,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,2,1,2,1,0,0,0,0]};
    </script>
</body>
</html>

@alexdima
Copy link
Member

alexdima commented Sep 20, 2018

@rebornix It looks like typing is forcing tokenization (via auto indent typing), so typing quickly forces that tokenization executes for each keystroke:

image

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues editor-core Editor basic functionality and removed editor labels Sep 20, 2018
@alexdima alexdima added the important Issue identified as high-priority label Sep 20, 2018
@alexdima alexdima removed their assignment Sep 20, 2018
@rebornix rebornix added this to the September 2018 milestone Sep 20, 2018
@rebornix
Copy link
Member

Indent on type, suggest, snippet or any contribution checks whether it's cheap or not to tokenize when the content changes are affected. Now I added a line length check (2048) for the cheapToTokenize check, which ensures that it won't take longer than 20~30 ms most of the time.

@alexdima
Copy link
Member

🎉 Nice

@mjbvz
Copy link
Contributor

mjbvz commented Sep 27, 2018

With b4d09d2, I'm still seeing very choppy performance in example html file while typing near the end of the json section. Not sure if this is the same root cause but reopening for investigation

@mjbvz mjbvz reopened this Sep 27, 2018
@mjbvz mjbvz added the verification-found Issue verification failed label Sep 27, 2018
@rebornix
Copy link
Member

Typing at the end of the document will trigger a retokenization of the whole line which takes around 300ms on my machine, there is no other contribution being triggered in this case. I'd like to keep this issue open but move it out of Sept. @mjbvz thanks for the detailed testing!

@rebornix rebornix modified the milestones: September 2018, Backlog Sep 27, 2018
@rebornix rebornix added tokenization Text tokenization and removed editor-core Editor basic functionality labels Sep 27, 2018
@rebornix rebornix removed info-needed Issue requires more information from poster important Issue identified as high-priority labels Sep 27, 2018
@ecstrema
Copy link
Contributor

ecstrema commented Oct 1, 2020

long lines actually get in real code from time to time. For example, in one of my files, I have a huge dictionnary created with regexp from static values. In order to save space, I write this dict as an ultra-long one-liner.

It looks like it hasn't been mentionned here that this slowliness (is this a word?) happens only when word wrapping is off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues tokenization Text tokenization verification-found Issue verification failed
Projects
None yet
Development

No branches or pull requests

5 participants