Move git refresh status task to long running task (Bug #9544)#14456
Move git refresh status task to long running task (Bug #9544)#14456Xapphire13 wants to merge 18 commits intoatom:masterfrom Xapphire13:gitRefreshTask
Conversation
|
Awesome! Looks like there's quite a few lint and test failures though - could you please address those? |
|
Yeah sorry about that. Forgot to run the lint script. Fixing now =] |
…ies (without changing API)
… for some reason.
|
Finally fixed the tests =]. Seems that |
|
@50Wliu, what is the usual turnaround time for an Atom PR? |
|
It depends. There's a lot of changes happening right now, so I can't give you an estimate. It is in the todo list however. (I know that's not the answer you were looking for, but it's the best I can give.) |
|
Thanks for the PR, and thanks for being patient as we worked through it! There are a few concerns I have regarding this change as it stands. Items 1 and 2 are addressable, but 3 and 4 I'm not sure about for the short term. Definitely open to feedback especially from @smashwilson and @kuychaco.
|
…its on its own (e.g. crashes). Safeguarding repo.release() with a try/finally
|
Thanks for the review! I have updated with changes addressing items 1 and 2. I'm unsure of how to move forward with items 3 and 4 however. |
| startHandler = -> | ||
| if not handlerInstance? | ||
| handlerInstance = new Task require.resolve('./repository-status-handler') | ||
| terminatedSub = handlerInstance.on "exit", status -> |
There was a problem hiding this comment.
Looks like a minor typo here: (status) -> instead of status ->
There was a problem hiding this comment.
Oops. Removed the param entirely as it's unused
|
Anything else I can add to the PR? I'm eager to work on this to address any concerns. It seems like the bug im addressing is getting a lot of attention from people this PR could help. |
|
What's the holdup on merging this? |
|
I'm still concerned about the remaining issues I commented on above. Pinging @atom/core for additional 💭 s around this feature. |
|
No worries, if it gets merged, I want it to be the right code for the job =] |
|
My opinion, based on 3 and 4 in @BinaryMuse's comment, is that we should hold off merging this until the GitHub package exposes a service it can call. We've begun thinking about the right way to implement that. |
|
Abandoning until #1089 is resolved. The new PR at that time will likely share little code with this. |
|
Alright, after considerable discussion with the rest of the team, I'm opting to reopen this PR, get it up to date with the new changes in #15415, and get it merged in. Apologies for the back and forth as we've explored the various ways to fix the underlying issue, and thanks again @Xapphire13 for the PR. |
Description of the Change
This PR addresses #9544. The issue here is that upon gaining focus, Atom spins off a new task to update the repository status. Profiling Atom during this time shows that there is a lengthy (~ 2 seconds on my machine, longer on others') delay on the rendering thread due to the
child_process.fork(). This PR changes it so thateach repository has its ownthere is a single long running task that receives a message upon needing to update repo status. This moves the overhead of thechild_process.fork()into a single hitper repo(I am experiencing zero noticeable delay upon focus now).Alternate Designs
An alternate design would be to have a single task that handled messages for all repositories. I didn't go this route as I didn't want to change the method signatures in the areas I touched. If we did it at the workspace level, we would need to allow for passing in a reference to the task. And potentially add a few.destroy()methods to the layer that housed the task. I figure that it would be rare to have a number of repositories open at any given time that would cause negative effects due to the number of helper tasks alive.I managed to implement the alternate design without making a change to the API
Why Should This Be In Core?
This fixes an issue within core itself.
Benefits
Usability of Atom is increased as you spend less time per day waiting on a blocked rendering thread.
Possible Drawbacks
If you have a high number of repos open on Atom, you will have a high number of child processes.n/a
Applicable Issues
n/a