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

Support fingerprinting directories #11

Merged
merged 1 commit into from
Nov 16, 2020
Merged

Support fingerprinting directories #11

merged 1 commit into from
Nov 16, 2020

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Nov 16, 2020

Initial implementation for #4.

return abs(time.time() - self.last_modified * 1e-9) < min_dtime

def to_tuple(self):
return sum(sorted(self.tree_fprints.items()), ())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorted could likely be the "killer" of performance, while also would make us feel nice when we gain significant boost when we stop doing that ;)

would be important to provide some initial benchmarking setup, filed #12 with idea(s)

Copy link
Member Author

@jwodder jwodder Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without sorted, the fingerprints passed to the memoized function would be unstable, and caching wouldn't work reliably.

Copy link
Member

@yarikoptic yarikoptic Nov 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the purpose of it, but I wonder if/how it could be avoided. E.g. if "unstable" due to changes to the directory content -- until we introduce some include/exclude support, we should be fine even without it, which would help to lower the "expected caching overhead" and establish a new baseline to go from. If it is "unstable" because it is non-deterministic (but then why? without changes to file system I do not see why it would be happening), then indeed sorting of some kind is necessary unless we workaround somehow, and we should look into optimizing that somehow accounting on the fact that we might just need to discover that something changed instead of knowing the ultimate order.
again, worth looking in more detail on how git does it...

@yarikoptic
Copy link
Member

Great! yet to try, but looks good and green. left a note on sorted and next step probably would be to establish some basic benchmark(s) so we could see how subsequent changes effect it all

@yarikoptic yarikoptic merged commit b0a7c24 into master Nov 16, 2020
@jwodder jwodder deleted the gh-4 branch November 17, 2020 13:28
@yarikoptic yarikoptic mentioned this pull request Feb 9, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants