-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add compilation cache to cython command #6091
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
Conversation
6e6abee to
5e32b6c
Compare
Co-authored-by: da-woods <[email protected]>
Co-authored-by: da-woods <[email protected]>
Co-authored-by: da-woods <[email protected]>
|
Rebased from master containing refactor of Cache code. Now PR is clean and ready for review. |
scoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would guess that it could be cleaner if the caching (not necessarily the Cache object creation) was done just around the call to run_pipeline(). Maybe add a wrapper function run_cached_pipeline?
implemented. |
scoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I had lost this from sight.
Cython/Build/Dependencies.py
Outdated
|
|
||
| if cache and fingerprint: | ||
| cached = cache.lookup_cache(c_file, fingerprint) | ||
| if cached: | ||
| if not quiet: | ||
| print("%sFound compiled %s in cache" % (progress, pyx_file)) | ||
| cache.load_from_cache(c_file, cached) | ||
| return | ||
| if not quiet: | ||
| print("%sCythonizing %s" % (progress, Utils.decode_filename(pyx_file))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a change in behaviour. It now always prints "Cythonizing…", even if it skips it due to the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I have fixed this by reverting the logic so we are calling lookup_cache() here again. For consistency, I am not calling here load_from_cache() here but continuing to shared compile logic where we load it from the cache.
We can consider whether we want to cache method lookup_cache() by using @cached_function...
dcc73f4 to
d6d5df8
Compare
609052e to
ac3016d
Compare
f6588e8 to
2e2a8bd
Compare
scoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine to merge if the changes I propose are ok with you.
Co-authored-by: scoder <[email protected]>
Co-authored-by: scoder <[email protected]>
Co-authored-by: scoder <[email protected]>
Co-authored-by: scoder <[email protected]>
|
All comments implemented. When CI/CD is green I will merge the PR to the master. |
Adds
--cacheargument to cython command. It is built on top of #6090 and should be merged after it.I suppose additional tests are needed to this PR. I will try to add to this PR.Tests added.
Related to #6070