strcspn(3) complexity improvement

From: Jeremie Le Hen (jeremie_at_le-hen.org)
Date: 03/30/05

  • Next message: Andrey Koklin: "ciss(4): speed degradation for Compaq Smart Array"
    Date: Wed, 30 Mar 2005 10:34:35 +0200
    To: freebsd-current@FreeBSD.org
    
    

    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 >
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Andrey Koklin: "ciss(4): speed degradation for Compaq Smart Array"

    Relevant Pages

    • looking for a patch to increase maximum routing table numnber
      ... patch, or send me a copy attached by email. ... Jeremie Le Hen ... < jeremie at le-hen dot org>< ttz at chchile dot org> ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: ACPI errors with recent laptop
      ... Thanks for your patch, it removed all warnings. ... but the manufacturer doesn't provide any BIOS upgrade ... Jeremie Le Hen ... < jeremie at le-hen dot org>< ttz at chchile dot org> ...
      (freebsd-current)
    • Re: Cant get MAC addr of an ed(4) adapter
      ... clearly an oversight on the rascal that's responsible for the ... I tested the patch on my friend's computer, ... Jeremie Le Hen ... < jeremie at le-hen dot org>< ttz at chchile dot org> ...
      (freebsd-current)
    • Re: "atacontrol info" isnt working here
      ... > posting and copying sos@. ... I made a patch for the manpage which is ... Jeremie Le Hen ... < jeremie at le-hen dot org>< ttz at chchile dot org> ...
      (freebsd-current)
    • Re: "atacontrol info" isnt working here
      ... > posting and copying sos@. ... I made a patch for the manpage which is ... Jeremie Le Hen ... < jeremie at le-hen dot org>< ttz at chchile dot org> ...
      (freebsd-current)