From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78656 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Asynchroneous image retrieval in HTML rendering Date: Mon, 02 May 2011 16:30:09 +0200 Organization: Programmerer Ingebrigtsen Message-ID: References: <87bozwfw84.fsf@gmail.com> <87r58ll8jm.fsf@gmail.com> <87liys4x04.fsf@gmail.com> <87tydewilm.fsf@gmail.com> <87liyp35fy.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1304346656 15188 80.91.229.12 (2 May 2011 14:30:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 May 2011 14:30:56 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M26958@lists.math.uh.edu Mon May 02 16:30:51 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QGu9C-0008T5-Lc for ding-account@gmane.org; Mon, 02 May 2011 16:30:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QGu8o-0000ER-P1; Mon, 02 May 2011 09:30:26 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QGu8n-0000EI-PR for ding@lists.math.uh.edu; Mon, 02 May 2011 09:30:25 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QGu8m-0007mt-OK for ding@lists.math.uh.edu; Mon, 02 May 2011 09:30:25 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QGu8j-0000aJ-SA for ding@gnus.org; Mon, 02 May 2011 16:30:21 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QGu8h-0008BW-Ld for ding@gnus.org; Mon, 02 May 2011 16:30:19 +0200 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2011 16:30:19 +0200 Original-Received: from larsi by cm-84.215.51.58.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2011 16:30:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 28 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.215.51.58.getinternet.no Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEWVc57bzeK2nsQ/ChRp Kjapj7oug7f/AAACUklEQVQ4jVWUwY7kIAxE3RlyD0i5B2t8bwk+gO3Qd+Id/v9XtgydlYZDi+ZR lMshIWq0EoZLYzwx7V27YH2Cr5QNZExXADXBBzzPOkEXUQOdJqgln/8BU2v3UQtXOs1jlc4MpwnO 9AhHGKALG1h776ggpWWXLX0AjuqLtKlYuB+pYKo8FNjfBng1hJlAoVgNtFFuww/NgDxA7zPg2s6p MEKDfADdQAWga5u9ytrSANiPlnTRoUAT9Xu2RK0sO9ASOkr5hV6dxcxnwNUUbrVTUnYw5c6iloM7 6UFZHstXJpZVNKAqBlh79EeRZXH14QNcrSViEo5+W7UzuegD4yj2qE2aQNEej817d/m9S7eWmBAg HKVsRIWhiEFUrJWYxL3X989SS4v7YJF64wjFViuyuFrNwwcDanX5jSrWXXEGVKMnVgg4blj9PhDP B+kXqqRgoC2bs04i/IVt2q9AAu++6jfN4RZZ0QpUdXQN0vS71lJKrfUhPVzRC+2oOcrizjrG+bC7 w1FJNg2+6Q3qSyLK4kgSOPiD6w3eEhGAA7Fn72U/b1DQIu5BKA6wAUxUkI41RIAQA2/1BlU9MhqA ReADy6lmA0gdFI826o4tEySsPwF2lstANFCx30AxEE1xAXCrZwY4JwiRL/IcACinG8gFT43ko4cH 3psBciqCYqKBYMClE7cwG2j4b7fEBAD5b05vGKUX+zEm2F2ln/P5AvgzNt6KnZynTI+fSjI88Win EFf1Xcm+BUv8HOWnx/iOZDTs+gU8XrIB0tP7X8AfdX6WXjf4B5tqsFjiy12WAAAAAElFTkSuQmCC Mail-Copies-To: never X-Now-Playing: Boris's _Japanese Heavy Rock Hits v3_: "16:47:52..." User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:CQH6zEBfMVwMvGR42VFYBbVy9JE= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78656 Archived-At: Antoine Levitt writes: > That doesn't change much for my test cases, so I guess the DNS lookup is > indeed the bottleneck. Have you verified that the DNS lookup is really the problem? Because I have more theories. :-) (Or, as scientists call it, "guesses".) One thing about the async image retrieval is that it's massively parallel. If there's 500 images in the article, Gnus will call `url-retrieve' 500 times in rapid succession, which will then fire off 500 HTTP connections (in parallel, more or less). I suspect that Emacs doesn't really like having this number of async socket sentinels going on at the same time, which means that the main Emacs thread gets no CPU time, which gives us interactive pauses. (And it's really rude towards the server. It's basically a one-Emacs DoS attack.) So I'm going to rewrite this by adding a new library, called, er, url-queue.el, which has the same interface as `url-retrieve', but which manages the parallelism in a more sensible way, by not having more than (for instance) four connections going at the same time. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/