From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alain Schneble Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Tue, 16 Feb 2016 22:37:45 +0100 Message-ID: <86egcc49qu.fsf@realize.ch> References: <8760y9kwrk.fsf@gnus.org> <87wpqpjgwy.fsf@gnus.org> <83a8nk1cxk.fsf@gnu.org> <87h9hrnc8x.fsf@gnus.org> <83powfzsqt.fsf@gnu.org> <87y4b393hl.fsf@gnus.org> <83io27ytu3.fsf@gnu.org> <87k2mmzkry.fsf@gnus.org> <83k2mlyet8.fsf@gnu.org> <87lh71nriy.fsf@gnus.org> <8637t8opla.fsf@realize.ch> <871t8skg6c.fsf@gnus.org> <86y4b0n5q2.fsf@realize.ch> <87fux7gb7o.fsf@gnus.org> <83wpqjvd2f.fsf@gnu.org> <87zivfobn4.fsf@gnus.org> <86y4ao5g1c.fsf@realize.ch> <87r3ggdo9f.fsf@gnus.org> <86twlb5yl4.fsf@realize.ch> <83d1rzz1mu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455658725 3856 80.91.229.3 (16 Feb 2016 21:38:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Feb 2016 21:38:45 +0000 (UTC) Cc: larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 16 22:38:45 2016 Return-path: Envelope-to: ged-emacs-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 1aVnKU-0001PK-5k for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2016 22:38:42 +0100 Original-Received: from localhost ([::1]:50995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVnKT-0003To-Ha for ged-emacs-devel@m.gmane.org; Tue, 16 Feb 2016 16:38:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVnKN-0003Ps-4T for emacs-devel@gnu.org; Tue, 16 Feb 2016 16:38:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVnKL-0002OQ-03 for emacs-devel@gnu.org; Tue, 16 Feb 2016 16:38:35 -0500 Original-Received: from clientmail.realize.ch ([46.140.89.53]:4926) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1aVnKG-0002I3-FD; Tue, 16 Feb 2016 16:38:28 -0500 Original-Received: from rintintin.hq.realize.ch.lan.rit ([192.168.0.105]) by clientmail.realize.ch ; Tue, 16 Feb 2016 22:38:05 +0100 Original-Received: from MYNGB (192.168.66.64) by rintintin.hq.realize.ch.lan.rit (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Tue, 16 Feb 2016 22:37:48 +0100 In-Reply-To: <83d1rzz1mu.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 14 Feb 2016 18:40:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To rintintin.hq.realize.ch.lan.rit (192.168.0.105) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] X-Received-From: 46.140.89.53 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:200058 Archived-At: Eli Zaretskii writes: >> From: Alain Schneble >> CC: Eli Zaretskii , >> Date: Sun, 14 Feb 2016 12:19:03 +0100 >> >> Lars Ingebrigtsen writes: >> >> > Alain Schneble writes: >> > >> >> The following patch removes the separate dns_processes list in favour of >> >> reusing Vprocess_alist. The latter list is now used to loop over all >> >> processes -- to check if pending DNS requests have completed. >> >> >> >> Do you agree whith this change? >> > >> > Well, it changes a test in the network loop that is basically a if (! >> > NILP (Qnil)) in 99.9999% (plus some nines) of the cases with code that >> > loops through all processes in the network loop all the time. >> >> True. Seems like I was too naive. I thought that these additional >> cycles were negligible (even though it's O(n)...). > > We could traverse the list when Emacs is idle and maintain the result > in a cache variable. What exactly do you mean by "when Emacs is idle"? The loop is in wait_reading_process_output and I thought that this is "kind of" executed when Emacs is idle. Or do you refer to idle timers? I tried to analyze the call graph starting from command_loop. I must be missing something... Is there yet another concept of "idleness" in Emacs?