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

import_project performance observations with git/gerrit backend #4752

Closed
ali-avci opened this issue Oct 23, 2020 · 3 comments
Closed

import_project performance observations with git/gerrit backend #4752

ali-avci opened this issue Oct 23, 2020 · 3 comments
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@ali-avci
Copy link

This might be also filed into questions section.

Due to the number of weblate projects and the items in each of them it may cause from time to time service outages on our git/gerrit backend. We are investigating in both directions gerrit and weblate.

Identified a place within weblate that might be made faster ~50x (recorded on our constellation).

git clone with the following variations on a repository with many branches and many commits is causing the huge difference in time consumption.

-depth=1 (4055 ms)
-depth=1 -no-single-branch (12350 ms)
-depth=1 -b "branch-specified-in-import-project" (245 ms)

We have two instances of Weblate installed v2.19.1 and v3.6.1.

I did apply a hot fix on both instances in two places of the source code.

Just reported this in here so that you may incorporate this to the main stream with your style.

Our migration path is a little different. We migrate weblate projects with the related business process behind it from the old versioned instance to the new one. Once finished with all projects we start the same iteration with the newest version of weblate again.

Regards,
-Ali

trans/management/commands/import_project.py

class command
method: checkout_tmp(....)
.....
gitrepo = VCS_REGISTRY[self.vcs].clone(repo,workdir, branch=branch)
.....

trans/vcs.py (2.19.1)

class GitRepository
method: clone(....)
.....
b_param = ['-b', branch] if branch else ['--no-single-branch']
cls._popen(['clone', '--depth', '1'] + b_param + [source, target])
.....

vcs/git.py (3.6.1)

class GitRepository
method: clone(....)
.....
b_param = ['-b', branch] if branch else ['--no-single-branch']
cls._popen(['clone', '--depth', '1'] + b_param + [source, target])
....

@nijel
Copy link
Member

nijel commented Oct 23, 2020

The reason for --no-single-branch is to be able to see branches for simplified setup when translating different branch.

@nijel nijel added the enhancement Adding or requesting a new feature. label Oct 23, 2020
@nijel
Copy link
Member

nijel commented Oct 23, 2020

(Slightly) related to #4325 - we might need to pass the actual branch to clone in all cases.

nijel added a commit that referenced this issue Oct 26, 2020
This is not strictly necessary right now, but will allow to simplity the API.

Issue #4752
@nijel nijel self-assigned this Oct 26, 2020
@nijel nijel added this to the 4.3.2 milestone Oct 26, 2020
@nijel nijel closed this as completed in b6c4e0f Oct 26, 2020
nijel added a commit that referenced this issue Oct 26, 2020
There is no code left which would not specify it.

Issue #4752
@github-actions
Copy link

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

nijel added a commit that referenced this issue Oct 26, 2020
The two config updates were fighting over the setting.

Issue #4752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants