source-integration icon indicating copy to clipboard operation
source-integration copied to clipboard

Slow GitLab fetching?

Open okainov opened this issue 5 years ago • 6 comments

I just tried to connect Mantis with my GitLab repo (~1400 commits) and when I clicked "Fetch latest changes" it looked hanging and using all my CPU more than for 5 minutes... Is it expected? Maybe you could add some progress bar to the page to show the users how is it going... because now it's just dead and using all CPU available...

okainov avatar Aug 16 '18 21:08 okainov

Average speed seems to be ~1 commit per second... So importing repo with 1000 commits will take around 15 minutes... Taking into account that you don't parse and load diffs but only commit messages it seems very slow

okainov avatar Aug 17 '18 15:08 okainov

Also it seems that function is not being terminated after finishing the full import. If I open mantis in another page, I can see that imported repo was created and replaced original repo, so it looks like done, but tab with full import is still doing something \ waiting for reply...

okainov avatar Aug 17 '18 15:08 okainov

Taking into account that you don't parse and load diffs but only commit messages it seems very slow

I didn't have a deeper look, but did you measure that the MantisBT / plugin part is the bottleneck? Maybe the GitLab part is the slow one.

atrol avatar Aug 18 '18 13:08 atrol

Even if it's Gitlab (which I'm really not sure, because I can clone my repo in less than 1 minute. I assume Mantis should use API for fetching commits only and it should be even faster), it would be still very nice to show the progress and don't make impression of hanging process.

okainov avatar Aug 18 '18 14:08 okainov

Related to #92

luzpaz avatar Aug 18 '18 17:08 luzpaz

There are a lot of issues and things that can be improved with the full import process. Performance is one of them, but not the main problem IMO.

Ideally it should run as a background server process, and the GUI would simply query an API to report progress.

As for the slowness, bear in mind that for each individual changeset, the script is calling the Gitlab webservice to retrieve the commit's data, process it and then go through all the parents.

dregad avatar Aug 21 '18 14:08 dregad