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

Performance issues with a long line #270

Open
3 tasks done
joyofscripting opened this issue Aug 30, 2022 · 3 comments
Open
3 tasks done

Performance issues with a long line #270

joyofscripting opened this issue Aug 30, 2022 · 3 comments
Labels
help wanted Extra attention is needed performance

Comments

@joyofscripting
Copy link

joyofscripting commented Aug 30, 2022

Describe the bug

I discovered that my beloved installation of massCode gets a bit unresponsive and takes a longer time for searches when I add SQL snippets that contain long lists of comma-separated numbers in the WHERE-condition.

Normally massCode is very responsive. you can click anywhere and the UI will react immediately. Also searches are normally very fast, a real joy. But when you add a snippet of the mentioned type, massCode's UI will become less responsive, searches will take some time and while the search is performed, the UI is almost blocked.

Currently I have 216 snippets organized in massCode, mostly short SQL statements, Python and Swift code.

Of couse one could argue that a snippet with a list of 1000 comma-separated values is not really a snippet anymore. And I can absolutely understand this perspective. But it was working perfectly in previous versions. So it might be just some kind of bug.

To reproduce

  1. Add a new snippet with the title 'SQLTEST' in masscode
  2. Genererate a long list (>= 1000) of comma-separated numbers (see example file below) and paste them into the newly created snippet
  3. Set the syntax format of the snippet to SQL
  4. Select another snippet of your library
  5. Search for 'SQLTEST'

In my case the UI gets unresponsive after step 5 and the search takes some time (10 seconds). Once you fully deleted the created 'SQLTEST' snippet, everything works as before, the UI is responsive, the searches quick again.

list_of_1000_numbers.txt

Version

3.4.1

OS

Windows 10

Validations

@antonreshetov
Copy link
Member

@joyofscripting The previous versions in which everything was fine, is it below 3? Since the breaking change occurred in version 3, in which there was a switch from ace to codemiror and texmate grammars

@joyofscripting
Copy link
Author

joyofscripting commented Aug 30, 2022

@antonreshetov Yes, this might be true. I remember that it worked back in July and as far as I know version 3 saw the world at the beginning of August,

@antonreshetov
Copy link
Member

antonreshetov commented Aug 31, 2022

I originally thought it might be related to onigasm and it seems to be right. I found this issue zikaari/onigasm#6. Unfortunately the issue is not resolved.

I also tried replacing the sql grammar, the result is much better, but there are problems with the syntax highlighting in sqlserver

Original grammar - https://raw.githubusercontent.com/microsoft/vscode/main/extensions/sql/syntaxes/sql.tmLanguage.json

New grammar- https://github.com/textmate/sql.tmbundle/blob/master/Syntaxes/SQL.plist

Edit
This affects all grammars, so simply replacing them does not improve performance.

@antonreshetov antonreshetov added bug Something isn't working help wanted Extra attention is needed and removed pending triage labels Aug 31, 2022
@antonreshetov antonreshetov changed the title [Bug]: massCode UI and search gets slower if you have snippets with long lists of numbers Performance issues with a long line Aug 31, 2022
@antonreshetov antonreshetov added performance and removed bug Something isn't working labels Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed performance
Projects
None yet
Development

No branches or pull requests

2 participants