-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Improving Caching on GitHub Actions for Unchanged Assets between Commits #8781
Comments
The cache doesn't work effectively on CI yet, because from Parcel's perspective, every file has a modification time of the last checkout (i.e. a few seconds ago) which doesn't match the mtime that's listed in the cache. So every asset is treated as changed. |
Thank you for your reply. We could restore the mtime to the most recent commit the files individually had been changed with third party tools, is it something that can help make it more effective on CI ? Or perhaps, storing an md5 signature of each file inatead of looking up for the mtime ? But i guess this will occurs some performance issue. |
Yes, that is how I would imagine it to work. Though it should be considered by Parcel itself so that you don't have to actually set the mtime for each file (so where Parcel currently reads the mtime, it should instead use the commit time for unchanged files, and mtime for uncommited changes), this is also something that Facebook's watchman supports (and thus probably also more of their tooling) does. The other problem is node_modules, where you can't just take the mtime from the last commit. So we definitely want to support this, but there are some hurdles and nobody had enough time yet to build it. |
Alright 👍 |
This is something I'm interested in as well, but not just in a CI context. It would be amazing if this could be configurable to cover multiple use cases - e.g. I have a use case where I don't have a local Git repo, and there are a lot of images which get processed by Sharp, and the project is sometimes moved to a different root path - so mtimes and full resolved absolute paths are problematic with caching - it'd be great if I could opt in to caching based on local asset paths (if that's not the current behaviour already, which I don't know) and modification checks based on content hash - the performance penalty is negligible compared to several minutes of resizing images. |
Does something has changed ? |
No, unless you were on a very old Parcel version that wasn't using LighningCSS yet (and this is just faster uncached) |
Instead of relying on the |
Thank you for your open-source build tool. It is very fast and efficient.
I am currently trying to optimize my GitHub action by implementing caching.
🐞 Problem
Even though my stylesheets assets remain unchanged between two commits, the building step takes around 41210ms for parcel to build. However, when I run the command multiple times
yarn build:css
on my local computer with stylesheets assets unchanged, it only takes 415ms each time.Source: https://parceljs.org/features/development/#caching
This issue seems to be similar if it is helpful for you #5068 #5927 (comment)
Please let me know if you require any additional information.
🔦 Context
Rails on Rails 7.0.4.1 with cssbundling-rails and @parcel/core 2.8.3
Which outputs on the CI:
The cache is correctly created and restore
Let me know if you need more informations.
The text was updated successfully, but these errors were encountered: