From owner-svn-src-all@FreeBSD.ORG Mon Jul 14 19:37:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27D787BE for ; Mon, 14 Jul 2014 19:37:25 +0000 (UTC) Received: from forward1l.mail.yandex.net (forward1l.mail.yandex.net [IPv6:2a02:6b8:0:1819::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6C492B16 for ; Mon, 14 Jul 2014 19:37:24 +0000 (UTC) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [37.140.190.28]) by forward1l.mail.yandex.net (Yandex) with ESMTP id 953721520E28; Mon, 14 Jul 2014 23:37:11 +0400 (MSK) Received: from smtp3o.mail.yandex.net (localhost [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id 1E8D31E1B2A; Mon, 14 Jul 2014 23:37:11 +0400 (MSK) Received: from rainbowwarrior.torservers.net (rainbowwarrior.torservers.net [77.247.181.164]) by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPA id VDLoFBkwBd-b9nih9Bs; Mon, 14 Jul 2014 23:37:09 +0400 X-Yandex-Uniq: 6920776d-9aa4-45d3-a4e4-836e1bcf25ab DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1405366630; bh=SbWesc24Z/aPYKxHZ26751x9AqmTbeJBZJ929t7ZuZs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=ujxPUCGhTHkC58CUdlfeuKYukbGaHmwyo3zz99g2YaCffeR0JhmRbYfdSiiUAqMFU dNMZ4bc93angWpleQtdy0ub3Iip79bD0Bwcp5BOBhLBhmf/o/eSGETtA5aTOMHqy4v q+CFz+k/lRbmcVdFF17/nXUCSAB8GP9n7nOcbZvo= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Mon, 14 Jul 2014 20:37:56 +0100 From: Alexander Nasonov To: svn-src-all@freebsd.org Subject: Re: svn commit: r268566 - head/usr.bin/users Message-ID: <20140714193756.GA19466@neva> References: <201407120747.s6C7lpYE020200@svn.freebsd.org> <20140712195452.N3279@besplex.bde.org> <20140714192322.GA23366@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140714192322.GA23366@britannica.bec.de> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Joerg Sonnenberger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Mon, 14 Jul 2014 19:37:25 -0000 Joerg Sonnenberger wrote: > On Sat, Jul 12, 2014 at 09:34:28PM +1000, Bruce Evans wrote: > > Run time: > > C++ sort() was twice as slow as qsort() for sorting 1 million dummy > > users in the allocation tests. About 8 seconds instead of 4, except > > when compiled with -g -O0 it was 15 seconds instead of 4. > > I find that claim strange and not reproducable. In my tests, std::sort > tends to be significant faster than qsort. Attached is a small test > program that for me is twice as fast for sorting integers... Integers are faster indeed but I'm not sure about used-defined types like basic_string. qsort uses 3-way comparison while std::sort always uses less_than (a