Hi all,

As recently discussed on the 'Significant performance problems with
modprobe', the config_* and xmalloc_fget* API has some performance issues:
1. It uses locking getc
2. It does malloc/realloc/free for each line read

Now (1) is relatively simply fixable with getdelim(), getline() or
getc_unlocked(). And even get_line_from_file.c has comments that fixing
of (1) should about double the speed.

However, (2) is trickier, because the whole API is designed exactly for
this purpose only. I believe the uclibc version of config_* stuff
actually reuses the existing buffers (and also uses fgets!), but is not
suitable for bb mostly because grep, sort and some other applets depend
on the function to read lines separated with \0 bytes.

Would any of you have objections for me to rewrite the above APIs as
single parser_* API, which would be based loosely on the currently
implementation, but allow fixing of the above mentioned issues?

Cheers,
  Timo

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to