Re: [PATCH v2] Huge performance boost for recursion (cp, du, find, ls, rm, mv)
"Roberto A. Foglietta via busybox" <[email protected]> Thu, 2 Apr 2026 05:11:35 +0200
| Newsgroups | gmane.linux.busybox |
|---|---|
| Message-ID | <CAJGKYO6Qp0Bs58Bms9gbdMGBxg5vGGbT1WKw4OVWf9vRmU_6Dg@mail.gmail.com> |
On Wed, 1 Apr 2026 at 20:20, Jody Bruchon via busybox <[email protected]> wrote: > > On 2025-08-04 1:22 PM, Denys Vlasenko wrote: > > On Tue, Apr 16, 2024 at 4:10 AM Jody Bruchon <[email protected]> wrote: [...] > > + buf = (char *)malloc(end_offset + 1); > > + if (!buf) return NULL; > > > > Use xmalloc. > > Fair. Sorry. > > > + if (dirp->d_name && DOT_OR_DOTDOT(dirp->d_name)) > > + return NULL; > > > > dirp->d_name is never NULL, don't check for that. > > True. I can remove that part. I tend to code defensively, but I see that > check's lack of value here. Defensive coding about p != NULL is a good practice that shouldn't be avoided unless a branch-analyzer is used as an automatism to grant p != NULL at every code change. https://github.com/robang74/busybox/commits/features/ In the meantime, I rewrote the features branch repairing tabs from spaces and added this Jody's patch with two variations: xmalloc (ok) and cleanup comments //previous function. #ifndef USE_FAST_SUBPATH newfile = concat_subpath_file(filename, entry->d_name); #else newfile = concat_subpath_file_fast(filename, entry); #endif The above approach will help confrontation and further tests on different platforms. Cache optimisations are great usually, but their results are varying among platforms. Best regards, R- _______________________________________________ busybox mailing list [email protected] https://lists.busybox.net/mailman/listinfo/busybox