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

Fix external editor delay. #1579

Merged
merged 2 commits into from
Aug 12, 2023
Merged

Conversation

kosayoda
Copy link
Contributor

@kosayoda kosayoda commented Mar 2, 2023

The default polling rate of 1 second causes a 1 second delay when queuing the event to launch the external editor, causing borderline unusable latency.

However, a slower polling helps reduce CPU usage (not tested), so let's have a short polling duration as long as there are input events, and slow poll otherwise.

Since the external editor among other components (not tested) is always launched in response to an input event, we reduce the latency to ~100ms, which is the fast poll duration.

Fixes #1506.

@kosayoda
Copy link
Contributor Author

kosayoda commented Mar 2, 2023

Questions:

  • Do we still need the "opening external editor" popup if this PR fixes the delay? I tested not having the popup and it "feels faster" visually.
  • Do we want a shorter "fast poll" duration? Personally I notice the latency drop when decreasing down to a 50ms poll duration but 100ms should be pretty snappy for most people.
  • Actions builds are failing but it seems like a CI configuration issue?

@extrawurst
Copy link
Owner

please rebase on current master. should fix the CI

The default polling rate of 1 second causes a 1 second delay when
queuing the event to launch the external editor, causing borderline
unusable latency.

However, a slower polling helps reduce CPU usage (not tested), so let's
have a short polling duration as long as there are input events, and
slow poll otherwise.

Since the external editor among other components (not tested) is always
launched in response to an input event, we reduce the latency to ~100ms,
which is the fast poll duration.
@kosayoda
Copy link
Contributor Author

Hi! Just wondering if there's still anything to be done on my end.

@extrawurst extrawurst merged commit bf31f20 into extrawurst:master Aug 12, 2023
16 of 19 checks passed
IndianBoy42 pushed a commit to IndianBoy42/gitui that referenced this pull request Jun 4, 2024
The default polling rate of 1 second causes a 1 second delay when
queuing the event to launch the external editor, causing latency.

However, a slower polling helps reduce CPU usage, so let's
have a short polling duration as long as there are input events, and
slow poll otherwise.

Since the external editor among other components (not tested) is always
launched in response to an input event, we reduce the latency to ~100ms,
which is the fast poll duration.

Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delay when opening external editor
2 participants