From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Guile's I/O procedures should *not* do thread synchronization Date: Sun, 06 Apr 2014 02:08:14 -0400 Message-ID: <87y4zjt2gh.fsf@yeeloong.lan> References: <1395746068-20604-1-git-send-email-dfsr@riseup.net> <87lhvys6ug.fsf@pobox.com> <87vbv1ilzl.fsf_-_@yeeloong.lan> <878urxpds1.fsf@pobox.com> <87r45pht6w.fsf@yeeloong.lan> <87vbv0oibe.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1396764586 18177 80.91.229.3 (6 Apr 2014 06:09:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2014 06:09:46 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 06 08:09:39 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WWgGw-00026R-Iy for guile-devel@m.gmane.org; Sun, 06 Apr 2014 08:09:38 +0200 Original-Received: from localhost ([::1]:56978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWgGv-0001ud-MX for guile-devel@m.gmane.org; Sun, 06 Apr 2014 02:09:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWgGn-0001uX-MT for guile-devel@gnu.org; Sun, 06 Apr 2014 02:09:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWgGh-0001h4-FI for guile-devel@gnu.org; Sun, 06 Apr 2014 02:09:29 -0400 Original-Received: from world.peace.net ([96.39.62.75]:46086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWgGh-0001h0-Ax for guile-devel@gnu.org; Sun, 06 Apr 2014 02:09:23 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1WWgGa-0004QG-04; Sun, 06 Apr 2014 02:09:16 -0400 In-Reply-To: <87vbv0oibe.fsf@pobox.com> (Andy Wingo's message of "Wed, 26 Mar 2014 20:45:09 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17039 Archived-At: Andy Wingo writes: >>>> However, if we promise to do thread synchronization, we will condemn >>>> Guile to forever having dog slow 'read-char', 'peek-char', 'write-char', >>>> 'get-u8', 'peek-u8', and 'put-u8' operations. >>> >>> I think you are wrong about "dog slow". Uncontended mutexes are fast, >> >> I did some benchmarks of 'putchar' vs 'putchar_unlocked' in C, without >> contention. I think it's fair to assume that the GCC and GLIBC folks >> did a reasonably good job of making both of these as fast as they could. >> >> With gcc -O2, I tested two variants of this program: one with 'putchar' >> and one with 'putchar_unlocked'. On my YeeLoong (mips64el w/ N32 ABI), >> the 'putchar_unlocked' version is faster by a factor of 26.3. > > On my i7-2620M, the difference is only a factor of 3.0. > > Now I think I understand your perspective; 26x is terrible. But surely > this is an architecture problem, and not a Guile problem? The world > will only get more multithreaded, and ignoring that does no one any > service. Now that I have access to the GCC Compile Farm, I repeated these benchmarks on a variety of machines, and here are the results: Ratio CPU ======================= 26.3 Loongson 2F 14.0 PowerPC (Power7) 13.7 Loongson 3A 9.33 ARMv6l 6.47 UltraSparc IIe 5.09 AMD Athlon II 4.27 AMD Opteron 3.46 Core 2 Duo P8600 ======================= Mark