⚡ Optimize file deletion strategy in customize.sh#13
Conversation
Replaces the inefficient `-exec rm -f {} +` with `-delete` in `find` commands to reduce process creation overhead.
Splits the `find` command into two passes:
1. Directory deletion using `-prune` and `rm -rf` (preserving efficient tree pruning).
2. File deletion using `-delete` (leveraging internal unlink for speed).
Benchmark results show up to ~12% improvement on large file sets (10,000 loose files).
Co-authored-by: tryigit <40565628+tryigit@users.noreply.github.com>
|
👋 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This PR optimizes the
gpu_cache_cleanerfunction inMagisk Template/customize.shby replacing thefind ... -exec rm -f {} +command withfind ... -delete.Since
find -deleteimplies-depth(which disables-prune), the logic was split into two separatefindcommands:-pruneandrm -rfto efficiently remove entire cache directory trees without traversing their contents.-deleteto remove individual cache files found outside the pruned directories.Performance Impact:
Benchmarks (
tests/benchmark.sh) demonstrate a performance improvement, particularly when cleaning many loose files:This change maintains compatibility with BusyBox/Toybox environments while reducing system call overhead.
PR created automatically by Jules for task 16779784089382521043 started by @tryigit