From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Power: blink-cursor-mode is a pig Date: Sat, 31 Dec 2011 11:59:56 +0100 Message-ID: References: <4EFCFDCA.6060802@dancol.org> <831urmv30g.fsf@gnu.org> <4EFD826D.2060309@dancol.org> <83pqf6theu.fsf@gnu.org> <677E3CA4-7D51-46AA-A499-0ECCDF828847@math.s.chiba-u.ac.jp> <83k45et6mj.fsf@gnu.org> <73A8B027-572E-4A53-A672-679C6CE689F4@math.s.chiba-u.ac.jp> <834nwhtdw9.fsf@gnu.org> <4EFEB817.5000501@dancol.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1325329211 19567 80.91.229.12 (31 Dec 2011 11:00:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2011 11:00:11 +0000 (UTC) Cc: Eli Zaretskii , Daniel Colascione , Emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 31 12:00:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgwfW-000106-St for ged-emacs-devel@m.gmane.org; Sat, 31 Dec 2011 12:00:07 +0100 Original-Received: from localhost ([::1]:43732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgwfW-0001Dd-IU for ged-emacs-devel@m.gmane.org; Sat, 31 Dec 2011 06:00:06 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgwfT-0001Bx-0T for Emacs-devel@gnu.org; Sat, 31 Dec 2011 06:00:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgwfQ-0002wU-Vi for Emacs-devel@gnu.org; Sat, 31 Dec 2011 06:00:02 -0500 Original-Received: from mailout.melmac.se ([62.20.26.67]:49681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgwfQ-0002vK-Pz for Emacs-devel@gnu.org; Sat, 31 Dec 2011 06:00:00 -0500 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id DC9619E26 for ; Sat, 31 Dec 2011 11:59:55 +0100 (CET) Original-Received: (qmail 2103 invoked by uid 89); 31 Dec 2011 10:58:59 -0000 Original-Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 31 Dec 2011 10:58:59 -0000 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 28E157FA058; Sat, 31 Dec 2011 11:59:55 +0100 (CET) In-Reply-To: X-Mailer: Apple Mail (2.1251.1) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 62.20.26.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147084 Archived-At: Hello. 31 dec 2011 kl. 08:42 skrev YAMAMOTO Mitsuharu: >=20 > On 2011/12/31, at 16:21, Daniel Colascione wrote: >=20 >> On 12/30/11 11:10 PM, Eli Zaretskii wrote: >>>> From: YAMAMOTO Mitsuharu >>>> Date: Sat, 31 Dec 2011 12:47:19 +0900 >>>> Cc: dancol@dancol.org, >>>> Emacs-devel@gnu.org >>>>=20 >>>> BTW, stopping/suspending timers does not avoid Emacs to wake up >>>> in a short period on some ports, depending on how its `select' >>>> emulation is implemented. At least, this applies to the NS port >>>> because it does periodic polling inside its `select' >>>> implementation when there are some subprocesses or network >>>> connections. >>=20 >> Why? Some Cocoa limitation? >=20 > I don't know for sure. Maybe for compatibility with GNUstep? >=20 > The Mac port uses either Grand Central Dispatch (on Mac OS X 10.6 > or later) or Pthreads with CFRunLoopSource so as to avoid > periodic polling in the `select' emulation. IIUC, both are > specific to Mac OS X, if not Carbon. The CF suggests Core Foundation, so it is not Carbon specific (but still = OSX specific). An alternative for OSX would be to use CFFileDescriptor, but that is = 10.5 or later. I think the current ns-select tries to work on GNUStep also. But the = polling it does is not good for performance, it accounts for half of the = slowdown flyspell-buffer (for example) currently sees in the NS-port. Going back to select, there used to be a half a second timeout added to = select (if the current timer timeout was longer) to handle timeouts that = various toolkits use for example menu activation and scrollbar repeats. = As Emacs are/was not using the toolkit specific event loop, those = timeouts where missing. This was mostly Motif and Gtk+. I think we = don't do that anymore. For the Gtk+ case we now use the Gtk+ event = handling. For Motif, we add the timeout when we know there is a menu = activation or a scroll in progress, and remove it afterwards. So there = should be no polling going on if blink-cursor if off and Emacs is idle. Jan D.