From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69277 Path: news.gmane.org!not-for-mail From: Dan Christensen Newsgroups: gmane.emacs.gnus.general Subject: Re: faster gnus-thread-latest-date Date: Wed, 09 Dec 2009 22:03:09 -0500 Message-ID: <87y6lbfs42.fsf@uwo.ca> References: <87my1uiien.fsf@uwo.ca> <87hbs2yw7f.fsf@uwo.ca> <87aaxt6zwy.fsf@lifelogs.com> <873a3lj89l.fsf@uwo.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260414307 10731 80.91.229.12 (10 Dec 2009 03:05:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Dec 2009 03:05:07 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M17682@lists.math.uh.edu Thu Dec 10 04:04:59 2009 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.50) id 1NIZKt-0000Aw-2h for ding-account@gmane.org; Thu, 10 Dec 2009 04:04:59 +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 1NIZJe-0004in-Pe; Wed, 09 Dec 2009 21:03:42 -0600 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 1NIZJd-0004id-J1 for ding@lists.math.uh.edu; Wed, 09 Dec 2009 21:03:41 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1NIZJb-00027q-Vp for ding@lists.math.uh.edu; Wed, 09 Dec 2009 21:03:41 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1NIZJb-0002tJ-00 for ; Thu, 10 Dec 2009 04:03:39 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NIZJa-0008LK-P8 for ding@gnus.org; Thu, 10 Dec 2009 04:03:38 +0100 Original-Received: from bas3-london14-1096779038.dsl.bell.ca ([65.95.133.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Dec 2009 04:03:38 +0100 Original-Received: from jdc by bas3-london14-1096779038.dsl.bell.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Dec 2009 04:03:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: bas3-london14-1096779038.dsl.bell.ca User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:5fIMShgul3+80p0tjsFdFiTKbZ4= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69277 Archived-At: I'm now thinking that caching the parsed time in "time value" format (a pair of integers) rather than a float might be more useful, since many parts of Gnus need this information. For example, gnus-dd-mmm and gnus-user-date take the date in this format to produce the summary lines. If the user is using dates for sorting and in summary lines, then the slow part (parse-time-string) will only need to be done once. But in looking around the code, I noticed the following discrepancies: In gnus-thread-latest-date, the time value is computed using (mail-header-parse-date (mail-header-date header)) and mail-header-parse-date is an alias for ietf-drums-parse-date, which is defined to be (apply 'encode-time (parse-time-string string)). On the other hand, *every* other part of Gnus that needs to convert a date string to a time value uses date-to-time, which is defined to be (apply 'encode-time (parse-time-string (timezone-make-date-arpa-standard date))) The comments near the last one suggest that this makes conversion more robust. However, it is 3 times slower than the first way. Since everywhere else in Gnus uses the slower way, and we're going to cache the output anyways, I guess the right thing to do is to switch gnus-thread-latest-date to use date-to-time as well. Once this is done, is there any reason to keep ietf-drums-parse-date around? It's not used anywhere else in the code that I can see. Dan