From owner-svn-src-all@FreeBSD.ORG Wed Jan 18 19:07:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED3A1065670; Wed, 18 Jan 2012 19:07:15 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 15E8D8FC22; Wed, 18 Jan 2012 19:07:14 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0IJ7Eb1025180; Wed, 18 Jan 2012 14:07:14 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0IJ7E7u025179; Wed, 18 Jan 2012 14:07:14 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Wed, 18 Jan 2012 14:07:14 -0500 From: David Schultz To: David Chisnall Message-ID: <20120118190714.GA13375@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111201445.pAKEjgNR096676@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111201445.pAKEjgNR096676@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r227753 - in head: contrib/gdtoa include lib/libc/gdtoa lib/libc/gen lib/libc/locale lib/libc/regex lib/libc/stdio lib/libc/stdlib lib/libc/stdtime lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 19:07:15 -0000 On Sun, Nov 20, 2011, David Chisnall wrote: > Author: theraven > Date: Sun Nov 20 14:45:42 2011 > New Revision: 227753 > URL: http://svn.freebsd.org/changeset/base/227753 > > Log: > Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a > load of _l suffixed versions of various standard library functions that use > the global locale, making them take an explicit locale parameter. Also > adds support for per-thread locales. This work was funded by the FreeBSD > Foundation. > > Please test any code you have that uses the C standard locale functions! > > Reviewed by: das (gdtoa changes) > Approved by: dim (mentor) This patch appears to cause a large performance regression. For example, I measured a 78% slowdown for strtol(" 42", ...). Furthermore, the resulting static binary for a trivial program goes from 7k to 303k, due to pulling in malloc, stdio, and all the pthread stubs. Presumably the capabilities of the non-xlocale entry points aren't appreciably changed, so there ought to be a way to avoid the overhead for them. Do you have any thoughts on this? Some more minor issues... It's also customary to document public APIs so that, for instance, `man printf_l' pulls up a page with the prototype, required #includes, and behavior. Aliasing manpages with MLINKS as appropriate is fine; for instance, Darwin's manpages on these functions look like a good example to follow. Finally, I'm not usually one to be picky about style, but could you make a pass to clean things up a little bit to match the surrounding code, wrap multiline comments to 80 columns, etc? You've also added new copyright notices for one-line changes (e.g., stdio/vdprintf.c, gdtoa/machdep_ldis?.c) and multiple copyright notices in the same file (locale/collate.c), which could be cleaned up concurrently.