Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Async getStatus? #16

Open
demian85 opened this issue Jan 9, 2014 · 9 comments
Open

Async getStatus? #16

demian85 opened this issue Jan 9, 2014 · 9 comments
Labels

Comments

@demian85
Copy link

demian85 commented Jan 9, 2014

getStatus is really slow for big repositories and freezes my app UI (node-webkit) during the execution of that method.
I think the solution is an async version to avoid freezing the main UI/DOM thread when performing computations.
Maybe I could use workers, but why is that method taking so much time? 2+ seconds...

@kevinsawicki
Copy link
Contributor

Are you calling it with a path or with no arguments?

If you are calling it without a path then it is probably best to run it in a separate child process since it can take some time for large repositories.

Adding an async version would work too but that isn't supported yet.

@demian85
Copy link
Author

demian85 commented Jan 9, 2014

I'm calling that method with no arguments. But still, I don't understand
why is it so slow.
I need to get the initial status when the app is loaded.
Executing 'git status' is way too fast compared to it!

On Thu, Jan 9, 2014 at 1:47 PM, Kevin Sawicki [email protected]:

Are you calling it with a path or with no arguments?

If you are calling it without a path then it is probably best to run it in
a separate child process since it can take some time for large repositories.

Adding an async version would work too but that isn't supported yet.


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-31951695
.

@kevinsawicki
Copy link
Contributor

Hmm, yeah, not sure why it would be slower than git status at the command line, worth looking into.

Is the repo you are trying it out on public?

@demian85
Copy link
Author

demian85 commented Jan 9, 2014

mm no sorry, it's a private intranet web app, but i can tell you it has at
least three thousand files inside... :P

On Thu, Jan 9, 2014 at 1:59 PM, Kevin Sawicki [email protected]:

Hmm, yeah, not sure why it would be slower than git status at the command
line, worth looking into.

If the repo you are trying it out on public?


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-31953039
.

@demian85
Copy link
Author

Could take a look at this? Or should I report the issue in the libgit repo?

@kevinsawicki
Copy link
Contributor

I'll take a look, but it make take me some time to find a repo that reproduces the behavior you are seeing.

@demian85
Copy link
Author

I think you just need to be sure nothing weird is going on inside that function.
It seems that the whole directory contents are scanned recursively every time the function is called, and just to get status information. Shouldn't that be cached somehow? How does Git do it?
A temp solution for me could be to just parse git statusoutput :/

@demian85
Copy link
Author

I've just implemented my own getStatus parsing git status --porcelain -z output and realized there is missing info in your method that could be useful: unmerged paths.

@billybonks
Copy link
Contributor

@demian85 do you know if this is still an issue?

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

No branches or pull requests

4 participants