Date: Wed, 30 Mar 2005 10:34:35 +0200 From: Jeremie Le Hen <jeremie@le-hen.org> To: freebsd-current@FreeBSD.org Subject: strcspn(3) complexity improvement Message-ID: <20050330083435.GI75546@obiwan.tataz.chchile.org>
next in thread | raw e-mail | index | archive | help
Hi list, Andreas Hauser made a patch to strcspn(3) for the DragonFly project which makes it faster when dealing with long strings [1] (rev 1.4). It basically changes the complexity of the function from O(strlen(str) * strlen(chars)) to O(strlen(str) + strlen(chars)) by using a charset. I have two questions. First, is this change worth enough to be merged in FreeBSD (this function is currently used in 42 binaries from /{,usr/}{s,}bin) ? I mean does the performance gain on large strings compensates the use of a large 256-bytes buffer ? Second, I would like to know how to deal with the copyright update. ATM, I changed the top of the copyright (up to Andrea's email address), is it acceptable ? The temporary patch is here [2], I didn't have time to try it yet, this is why it is not attached with this email. Best regards, [1] http://www.dragonflybsd.org/cvsweb/src/lib/libc/string/strcspn.c [2] http://jeremie.le-hen.org/~tataz/patches/FreeBSD/libc.strcspn.dfbsd.patch -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050330083435.GI75546>