Last month, I built a CI solution for our project and adding a conflict detector to our build commands. This script runned so slow because it will check all application files (and our application codebase has many of css, js files).
This was the script
Today, I think why don’t we just check recently updated files (in the latest commit) ??? Then I have this new script
conflict_detector.sh is the filename of script, we exclude it from check to make sure changing this file doesn’t make it failed.
You can use this approach to check linter, coding standard or run preprocessor ;)
Result (in my context) :
- Old script : 12 seconds
- New script : ~ 50ms (200 times faster)
be Automated, be Fast, but be Careful !