⚡ perf: use -delete instead of -exec rm for files in find#17
Conversation
Replaced the second pass of `find` in `gpu_cache_cleaner` with the built-in `-delete` predicate. This optimization avoids the overhead of spawning an external `rm` process, significantly improving performance as demonstrated by `tests/benchmark.sh`. Modified `tests/benchmark.sh` to provide more accurate comparisons between the current and optimized implementations. - Baseline (current): ~354ms - Optimized (-delete): ~183ms - Improvement: ~48% reduction in execution time
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
⚡ Optimized GPU Cache Cleaning Performance
💡 What:
Replaced
-exec rm -f {} +with the more efficient-deleteflag in thefindcommand used bygpu_cache_cleanerinMagisk Template/customize.sh.🎯 Why:
Spawning an external
rmprocess (even with the+argument to group files) introduces significant CPU and I/O overhead compared to the built-in-deleteaction infind.📊 Measured Improvement:
Using the updated
tests/benchmark.shscript, the performance improvement was measured by simulating a large number of cache files and directories:-exec rm)-delete)The optimized version is consistently nearly twice as fast in the benchmark scenario.
✅ Verification:
tests/verify.sh: PASS (Confirmed that shader cache and gpu cache directories/files are still correctly removed).tests/benchmark.sh: Confirmed significant performance gain.PR created automatically by Jules for task 2030324025241024058 started by @tryigit