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

GitHub package sometimes causes stuttering when switching buffers #14

Open
5 tasks done
savetheclocktower opened this issue Jan 24, 2023 · 3 comments
Open
5 tasks done
Labels
bug Something isn't working

Comments

@savetheclocktower
Copy link

savetheclocktower commented Jan 24, 2023

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

In certain circumstances — one I can reliably reproduce, and others that are more sporadic — the GitHub package seems to be the cause of a stuttering behavior that occurs when a buffer is made active. It appears to block the UI while it's doing work: the editor is unresponsive to clicks, and syntax highlighting stops partway through the file. The stuttering stops after a couple seconds.

I did a performance profile and it seems to be because the app is spending an unusual amount of time shelling out to git. Here's a shot of one profile I did:

Screen Shot 2023-01-24 at 11 47 38 AM

I put in a conditional breakpoint just so I could log the actual shell commands that are being run:

Screen Shot 2023-01-24 at 11 35 08 AM

Here's what that looks like:

Screen Shot 2023-01-24 at 11 34 54 AM

I had it log the arguments to exec along with a timestamp. You can see that the invocations of exec are spread several seconds apart. In theory it's good that the package seems to be yielding to the UI several times in between, but in practice the UI is still unresponsive until all these shell commands are done running.

In all these instances, the stuttering is occurring when (a) I've got a specific project open; (b) I open my snippets.cson within that project via Pulsar → Snippets…. The stuttering occurs on first open and whenever I switch tabs to a different buffer and then return to the snippets.cson tab. It does not occur when I switch between buffers for files within my project, but I've noticed similar symptoms when opening a project for the first time.

I can only guess that the package has to do extra work when I switch to editing a file that's not an ancestor of the project's root directory — it has to get some repo metadata that evidently doesn't get cached.

Atom 1.60.0 doesn't exhibit this behavior. I wanted to ascertain that it was hitting that same code path, but I can't, because git-shell-out-strategy.js doesn't exist in the equivalent location in the Atom.app bundle, nor can I find that file within the devtools.

Disabling the GitHub package definitely fixes the snippets.cson issue, and seems to improve startup time when opening a project.

Pulsar version

1.101.0-beta

Which OS does this happen on?

🍎 macOS

OS details

11.7.2

Which CPU architecture are you running this on?

64-bit(x86_64)

What steps are needed to reproduce this?

  1. Open a project that does not contain ~/.atom/snippets.cson as an ancestor. Open a couple of source files for editing.
  2. Open your snippets file via the menu. Observe the stuttering.
  3. Switch to another tab. No stuttering should happen.
  4. Switch back to the snippets.cson tab. Stuttering will happen.

Additional Information:

No response

@savetheclocktower savetheclocktower added the bug Something isn't working label Jan 24, 2023
@confused-Techie
Copy link
Member

Thanks a ton for contributing!

This is an issue we are aware of and have marked as a Notice currently. But do appreciate having some solid numbers to compare with later on,

@savetheclocktower
Copy link
Author

Ah, lovely. Is there an issue somewhere I can track?

@confused-Techie
Copy link
Member

Ah, lovely. Is there an issue somewhere I can track?

Not that I'm aware of just yet, just something we have been keeping a mental note of since the root cause hasn't been fully determined. But ideally this can now be the issue to track, so it's a good thing you put it in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants