From owner-freebsd-current@FreeBSD.ORG Fri Feb 11 15:06:40 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7729D16A4CE for ; Fri, 11 Feb 2005 15:06:40 +0000 (GMT) Received: from www.portaone.com (web.portaone.com [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id A910C43D1D for ; Fri, 11 Feb 2005 15:06:39 +0000 (GMT) (envelope-from sobomax@portaone.com) Received: from [192.168.1.26] (SIRIUS-ats227-UTC.ukrtel.net [195.5.25.154]) (authenticated bits=0) by www.portaone.com (8.12.11/8.12.11) with ESMTP id j1BF6Z7D007827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Feb 2005 16:06:37 +0100 (CET) (envelope-from sobomax@portaone.com) Message-ID: <420CC9F7.40802@portaone.com> Date: Fri, 11 Feb 2005 17:06:31 +0200 From: Maxim Sobolev Organization: Porta Software Ltd User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "developers@freebsd.org" Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/685/Wed Jan 26 10:08:24 2005 clamav-milter version 0.80j on www.portaone.com X-Virus-Status: Clean Subject: Pthreads performance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2005 15:06:40 -0000 Hi, Note: I am purposely posting this to developers to avoid banging into "FreeBSD 5/6 is slow" drum. My pthreads knowellege is pretty basic, so that it's possible that this all is false alarm. I've found a post on some of Russian technical forums in which author tries to compare performance of basic synchronisation primitives in various threading packages available on FreeBSD. The interesting part is that the linuxthreads clearly wins by a high margin - difference between it and the next follower (kse) is almost 3x. I had tried to find some error in the program logic, but failed. Another interesting thing is that libthr, which is conceptually very close to linuxthreads, provides worst result, being 8x slower than LT and almost 3x slower than kse/c_r. For those who can read Russian the original post can be found here: http://www.opennet.ru/base/sec/test_freebsd_threads.txt.html Following is result of the run on my 5.3-STABLE/UP. -bash-2.05b$ time ./aqueue_c_r -n 10000000 pusher started poper started real 0m17.826s user 0m17.766s sys 0m0.048s -bash-2.05b$ time ./aqueue_thr -n 10000000 pusher started poper started real 0m46.227s user 0m18.706s sys 0m27.423s -bash-2.05b$ time ./aqueue_kse -n 10000000 pusher started poper started real 0m15.477s user 0m15.432s sys 0m0.009s -bash-2.05b$ time ./aqueue_linuxthreads -n 10000000 pusher started poper started real 0m6.118s user 0m2.217s sys 0m0.932s -bash-2.05b$ Test case and script that compiles it can be found there: http://www.portaone.com/~sobomax/aqueue.c http://www.portaone.com/~sobomax/build.sh -Maxim