-
-
Notifications
You must be signed in to change notification settings - Fork 863
Optimize themes.py: 42% faster with hash caching and reduced I/O #702
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
Co-authored-by: GilbN <[email protected]>
Co-authored-by: GilbN <[email protected]>
Co-authored-by: GilbN <[email protected]>
Co-authored-by: GilbN <[email protected]>
Co-authored-by: GilbN <[email protected]>
Co-authored-by: GilbN <[email protected]>
|
@copilot If themes.json and this css/base//.css |
The .gitignore file only affects git tracking in the master/develop branches, not the CI/CD deployment process. Here's how it works:
The .gitignore ensures these generated files aren't committed to master/develop (keeping the repo clean), while the deployment action still picks them up from the filesystem and publishes them to the live branches. You can verify this: the generated files exist in the working directory after themes.py runs, they're just not tracked by git. |
xdmhrbrsdy-ux
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.
Milankdutta
The
themes.pyscript performed 4,535 MD5 hash operations and 4,486getcwd()calls to generate 2,378 CSS files, with 90% of runtime spent repeatedly hashing the same files.Changes
Hash Caching
_hash_cachedict to memoize MD5 results, reducing hash operations from 4,535 to 364 (92% reduction)System Call Reduction
getcwd()result, eliminating 4,485 redundant callsList Comprehension Optimization
file.split(".")[1] == "css"withfile.endswith('.css')Repository Hygiene
.gitignore(themes.json, css/base//.css excluding *-base.css)Performance
Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.