emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Power: blink-cursor-mode is a pig


From: Jan Djärv
Subject: Re: Power: blink-cursor-mode is a pig
Date: Sat, 31 Dec 2011 11:59:56 +0100

Hello.

31 dec 2011 kl. 08:42 skrev YAMAMOTO Mitsuharu:

> 
> On 2011/12/31, at 16:21, Daniel Colascione wrote:
> 
>> On 12/30/11 11:10 PM, Eli Zaretskii wrote:
>>>> From: YAMAMOTO Mitsuharu <address@hidden>
>>>> Date: Sat, 31 Dec 2011 12:47:19 +0900
>>>> Cc: address@hidden,
>>>> address@hidden
>>>> 
>>>> 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.
>> 
>> Why? Some Cocoa limitation?
> 
> I don't know for sure.  Maybe for compatibility with GNUstep?
> 
> 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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]