From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/74234 Path: news.gmane.org!not-for-mail From: Francis Moreau Newsgroups: gmane.emacs.gnus.general Subject: Re: Improving Gnus speed Date: Sun, 21 Nov 2010 22:46:23 +0100 Message-ID: References: <87zktemkwl.fsf@uwo.ca> <87vd42mdci.fsf@uwo.ca> <87y68vhj3q.fsf@uwo.ca> <87sjz3h9zo.fsf@uwo.ca> <871v6el86z.fsf@uwo.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1290376070 20520 80.91.229.12 (21 Nov 2010 21:47:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 21 Nov 2010 21:47:50 +0000 (UTC) Cc: ding@gnus.org To: Dan Christensen Original-X-From: ding-owner+M22599@lists.math.uh.edu Sun Nov 21 22:47:45 2010 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 1PKHlA-00061j-F2 for ding-account@gmane.org; Sun, 21 Nov 2010 22:47:44 +0100 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 1PKHkc-0007R0-08; Sun, 21 Nov 2010 15:47:10 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PKHkZ-0007Qn-9u for ding@lists.math.uh.edu; Sun, 21 Nov 2010 15:47:07 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PKHkU-0003tT-Em for ding@lists.math.uh.edu; Sun, 21 Nov 2010 15:47:06 -0600 Original-Received: from mail-ww0-f48.google.com ([74.125.82.48]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1PKHkT-00078D-00 for ; Sun, 21 Nov 2010 22:47:01 +0100 Original-Received: by wwb39 with SMTP id 39so6688081wwb.5 for ; Sun, 21 Nov 2010 13:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=79kseWrzWQRoze+Ui7st9p03nxaY2RKnGmnO5VlMXIs=; b=sWR8mpFTgrqxpeiVvUidPsg8ov5Ryeo28goedpRb3JVpxb8nNYgsTpznYMR3eM/OHV NNqVoWN6tun+B3bnshkLvd3buSwZHvnS6dq8kIkGTNl9OZxCajfZRaRnpsJMDvCXxXTs nWmz5WNhu0JQJk1zKUmyydl/zbPLzZuJhMR+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=W4XEwesA+QRnH40Mo3Pik/jnaXC6mDstEpYDzT0GEYsF5PViJjfF2it90FvLIs+zgi BZ6xst15igca51YFK5Co6+11CGwiMo4Ujuks4P1Pvv8Piv2WS3ZNQZuEp4r2tl4g6ivD mxFhdvvQWdip5aEHcDadqxlTH/apNMczsX7pE= Original-Received: by 10.227.137.71 with SMTP id v7mr5099529wbt.149.1290375987949; Sun, 21 Nov 2010 13:46:27 -0800 (PST) Original-Received: from localhost (au213-1-82-235-205-153.fbx.proxad.net [82.235.205.153]) by mx.google.com with ESMTPS id b30sm2824001wbb.16.2010.11.21.13.46.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Nov 2010 13:46:26 -0800 (PST) In-Reply-To: <871v6el86z.fsf@uwo.ca> (Dan Christensen's message of "Sun, 21 Nov 2010 15:42:44 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Spam-Score: -2.0 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:74234 Archived-At: Dan Christensen writes: > Lars Magne Ingebrigtsen writes: > >> Dan Christensen writes: >> >>> Separate from that low-level cache, the sorting function could >>> probably annotate the thread tree and re-use that information >>> for all of the recursive sorts. Or use a decorate-sort-undecorate >>> pattern. >> >> It sounds possible, but peeking at the code, it doesn't seem trivial to >> do generally, since the user can compose their own composited sorting >> functions. So the cache would have to be per >> article+sorting-function... hm... > > Re: caching: > > I think caching mainly makes sense for the functions which require > traversing the thread tree: gnus-thread-sort-by-total-score and > gnus-thread-sort-by-most-recent-number and -date. Are there > any others? If these tucked away their result when called, > I imagine there would be a big savings. Depending on the shape > of the tree, this would reduce sort key computation time from > somewhere between O(n log n) and O(n^2) to O(n). Yes but I still think that the wrong approach is currently done because all this sorting is mostly done for nothing. When I'm entering in the group, all threads are hidden. And I won't look at 80% of the actual threads. So sorting them are useless. I really think that sorting should happen only when threads are expanded. And that would reduce a _lot_ the number of threads to sort. -- Francis