Skip to content

Only gc.collect() under windows #686

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

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

jeblair
Copy link
Contributor

@jeblair jeblair commented Oct 9, 2017

Under Windows, tempfile objects are holding references to open files
until the garbage collector closes them and frees them. Explicit
calls to gc.collect() were added to the finalizer for the Repo class
to force them to be closed synchronously. However, this is expensive,
especially in large, long-running programs. As a temporary measure
to alleviate the performance regression on other platforms, only
perform these calls when running under Windows.

Fixes #605

Under Windows, tempfile objects are holding references to open files
until the garbage collector closes them and frees them.  Explicit
calls to gc.collect() were added to the finalizer for the Repo class
to force them to be closed synchronously.  However, this is expensive,
especially in large, long-running programs.  As a temporary measure
to alleviate the performance regression on other platforms, only
perform these calls when running under Windows.

Fixes gitpython-developers#553
openstack-gerrit pushed a commit to openstack-infra/zuul that referenced this pull request Oct 10, 2017
Timeout remote git operations after 300 seconds.

Because it could be in an invalid state, delete the local repo if a
timeout occurs (subsequent operations will recreate it).

This replaces our use of the clone_from() and fetch() methods from
GitPython with lower-level equivalents.  The high-level methods
do not currently permit the hard timeout.

The GitPython requirement is changed to a temporary fork until both

gitpython-developers/GitPython#682
and
gitpython-developers/GitPython#686

end up in a release.

Change-Id: I7f680472a8d67ff2dbe7956a8585fb3714119e65
@Byron Byron merged commit bfae362 into gitpython-developers:master Nov 2, 2017
@Byron
Copy link
Member

Byron commented Nov 2, 2017

Thanks a lot for this fix!
Performance tests exist, but unfortunately were never integrated so that they could actually fail a build when a regression is detected.

riley-martine pushed a commit to riley-martine/GitPython that referenced this pull request Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Performance degradation in 2.1.3
2 participants