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

NF: GitRepo._diffstatus() internal helper for global state evaluation (fixes gh-3342) #3343

Merged
merged 1 commit into from Apr 18, 2019

Conversation

@mih
Copy link
Member

@mih mih commented Apr 17, 2019

This is used inside GitRepo.diffstatus() to implement an early-stopping strategy that yields a state label for a subdataset at the earliest sign of a modification. #3342

Performance info:

Prep:

 import datalad.api as dl
 ds = dl.rev_create('deep')
 path = ds.pathobj  
 for i in range(20):       
      path = path / 'down'
      ds.rev_create(path)

followed by a

% touch deep/down/down/here

on present master

>>> timeit dl.Dataset('deep').status()
1 loop, best of 3: 1.16 s per loop

this PR

>>> timeit dl.Dataset('deep').status()
1 loop, best of 3: 198 ms per loop
This is used inside GitRepo.diffstatus() to implement and early-stopping
strategy that yields a state label for a subdataset at the earliest sign
of a modification.
kyleam
kyleam approved these changes Apr 17, 2019
Copy link
Contributor

@kyleam kyleam left a comment

It took me a while to make sense of the changes, but after stepping through some examples, it seems clear enough. And I can confirm the very nice speedup on the example given :]

@mih
Copy link
Member Author

@mih mih commented Apr 17, 2019

Appveyor actually passed already...

@mih mih merged commit 8bf7375 into datalad:master Apr 18, 2019
2 of 3 checks passed
@mih mih deleted the enh-status branch Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants