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

[studio] before/after editor performance is severely degraded with many lines of code #1272

Open
with-heart opened this issue Aug 22, 2024 · 4 comments

Comments

@with-heart
Copy link
Contributor

with-heart commented Aug 22, 2024

Issue Description

Select one of:
[ ] Generated codemod is not correct
[ ] Bug in Codemod Studio
[x] UI/UX improvement request
[ ] Feature request

In a Before/After editor with thousands of lines of code, I'm experiencing ~1s of lag for each character input and when blurring the editor.

Steps to Reproduce

In the before/after editor

  1. Add thousands of lines of code
  2. Attempt to type input and notice lag
  3. Blur the editor by switching to another panel and notice lag

Actual Results

Lag!

Expected Results

No lag!

Technical details

Export-1724284382458

Browser: Arc 1.56.0 (52658) in incognito mode
Device: MacBook Pro M1 Max, Sonoma 14.6.1

@alexbit-codemod
Copy link
Contributor

great catch. this happens when that code is parsable. if its not parsable there is no lag... so i guess its something related to that.... maybe on each keystroke we parse the whole tree? will look into it later and consider it as low pri for now.

curious, how did you come across this? like why do you put so much code in before/after? did you come here via codemod learn command?

@alexbit-codemod
Copy link
Contributor

alexbit-codemod commented Aug 22, 2024

even for rust-based parsers and ast-grep playground this problem appears.

@with-heart
Copy link
Contributor Author

curious, how did you come across this? like why do you put so much code in before/after? did you come here via codemod learn command?

Yeap, codemod learn on an xstate test file.

There are a few different variations of a change I'm wanting to make to the tests so I converted that whole file by hand and then ran it.

It kinda sucks that so much of the file was included in the editor just because I changed a single import. The second change wasn't until somewhere around line 1800 I think but all of the text in between them was included.

@alexbit-codemod
Copy link
Contributor

yeah. i wonder how we can improve codemod learn so it only extract relevant stuff to build the codemod or populate that in codemod studio.... i run this by the team to see if we can come up with some ideas. but if you have some, please share that with us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants