> Could you try changing busybox to use getc_unlocked? I suspect you have
> thread capable libc/uclibc and they are doing a lot of locking. Locking
> is cpu-wise expensive operation. Especially in this case as the lock is
> reacquired for *every character* in the dependency file.
> 
> That's only thing I can think of what could be going differently.
> 
> And this would be issue in the config_* function on libbb. And causing
> performance issues in multiple other places too.

I did the attached change, which improved bb somewhat, but it still
loses to the full one (without the .bins).

1.18.5 takes 1.9x as long as the full one on my test workload.
(attached, 64 modprobes, recorded from a typical boot)
1.18.5 with the patch takes 1.52x the time, better, but still slower.

I'm on standard x86/glibc, so reproducing this should be fairly easy.

- Lauri

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index a0ed919..4ab74f8 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -26,7 +26,7 @@ char* FAST_FUNC bb_get_chunk_with_continuation(FILE *file, 
int *end, int *lineno
        char *linebuf = NULL;
        int linebufsz = 0;
 
-       while ((ch = getc(file)) != EOF) {
+       while ((ch = getc_unlocked(file)) != EOF) {
                /* grow the line buffer as necessary */
                if (idx >= linebufsz) {
                        linebufsz += 256;

Attachment: modlist
Description: Binary data

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to