cmarcusreid / git-status-cache

High performance cache for git repository status. Clients can retrieve information via named pipe.
MIT License
16 stars 4 forks source link

Investigate performance discussed in posh-git#423 #21

Open cmarcusreid opened 7 years ago

cmarcusreid commented 7 years ago

Creating issue here to continue investigation of https://github.com/dahlbyk/posh-git/issues/423.

cmarcusreid commented 7 years ago

@Tasteful could you grab the executable from https://github.com/cmarcusreid/git-status-cache/releases/tag/v1.1.5-alpha and grab the timing information from the logs?

Tasteful commented 7 years ago

Here we have the new log with a lot of more timings

GitStatusCache_2017-02-20_10-43-00.0.txt

cmarcusreid commented 7 years ago

There are two slow requests in the log:

2017-02-20 10:43:23.179259 GitStatusCache.exe (0x00004ba0) 0x000014b8 Spam NamedPipeInstance.OnClientRequest.19 Call completed. Reporting timing. { "milliseconds": 22689.1, "call": "m_onClientRequestCallback(readResult.second)" }

2017-02-20 10:47:42.035621 GitStatusCache.exe (0x00004ba0) 0x000014b8 Spam NamedPipeInstance.OnClientRequest.19 Call completed. Reporting timing. { "milliseconds": 10730.8, "call": "m_onClientRequestCallback(readResult.second)" }

In both cases the vast majority of the cost is in git_status_list_new:

2017-02-20 10:43:23.170311 GitStatusCache.exe (0x00004ba0) 0x000014b8 Spam Git.GetFileStatus.377 Call completed. Reporting timing. { "milliseconds": 22669, "call": "git_status_list_new(&statusList.get(), repository.get(), &statusOptions)" }

2017-02-20 10:47:42.025614 GitStatusCache.exe (0x00004ba0) 0x000014b8 Spam Git.GetFileStatus.377 Call completed. Reporting timing. { "milliseconds": 10713.4, "call": "git_status_list_new(&statusList.get(), repository.get(), &statusOptions)" }

This is a libgit2 function, and unfortunately I don't see a way to retrieve the status more efficiently from within GitStatusCache. I think the next step is to follow-up with libgit2 experts about the function's cost on these repositories.

dahlbyk commented 7 years ago

Not sure if git_status_list_new is instrumented, but libgit2 does have a tracing API: trace.h