From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#14776: 24.3.50; [PATCH] parse-time-string performance Date: Thu, 04 Jul 2013 23:15:11 +0200 Message-ID: References: <87sizwxwu2.fsf@hochschule-trier.de> <87li5m1geu.fsf@hochschule-trier.de> <87k3l6jedt.fsf@hochschule-trier.de> <87ppuyhw32.fsf@hochschule-trier.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372972574 24482 80.91.229.3 (4 Jul 2013 21:16:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jul 2013 21:16:14 +0000 (UTC) Cc: 14776@debbugs.gnu.org To: Andreas Politz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 23:16:15 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Uuqsv-0000bl-DN for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 23:16:13 +0200 Original-Received: from localhost ([::1]:57782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuqsu-0008JZ-Ts for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 17:16:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuqso-0008GX-Vj for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 17:16:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uuqsk-0006C3-QC for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 17:16:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuqsk-0006By-Nq for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 17:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Uuqsk-00084D-Db for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 17:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2013 21:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14776 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14776-submit@debbugs.gnu.org id=B14776.137297252730929 (code B ref 14776); Thu, 04 Jul 2013 21:16:02 +0000 Original-Received: (at 14776) by debbugs.gnu.org; 4 Jul 2013 21:15:27 +0000 Original-Received: from localhost ([127.0.0.1]:58111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UuqsA-00082m-GV for submit@debbugs.gnu.org; Thu, 04 Jul 2013 17:15:27 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:41435) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uuqs7-00082d-E3 for 14776@debbugs.gnu.org; Thu, 04 Jul 2013 17:15:24 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Uuqrw-00056t-BX; Thu, 04 Jul 2013 23:15:12 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEXPpnmLXEC1imIyCAm/ l25gJiFtPObyAAACfklEQVQ4jVVSwbLkJgzUED7AwuYOesx9XRR3hiL3xYT//5W0PDObCvYB1OpG akH0Wa13DkS2995EpH/jVlLje/MG0iesB+fSf4B88xmEFj4Uxe5tk+Z6PKTXL9AbkenSW5TGSXr/ A+iuYx+FuYkGPgRIpdpCTeK3lhCB2JfRW7A2RA5NqR/GW5SMIbm62Go1Pb2BaivKsv4fE7SN3iOA wwLASdLLU0hV85trqBzRCjV28aJQ6eVQ9QGSXlEbtegWP0yldMjfDNPQqaVqTIvPwR5KzskY0g40 AS0Lo9YY/qjGHc05ZgGG+yRFvxbEpG1uMPNIZF0n84IbS/+oQSBXt+3o1COvhePymAgctg/08Uod JSkweCzXUe1m28eS7lTGxeErcXqGr13U5MX+meQ60GgcOtWbQzYZFAgAc4VYCHGz9rafjLsSNbfd M8PxqPZ2nRozFK/0fUhJJ6GMGAG8/gcoZKtjGPBK9Qu8nwqs2ngDAPtNSto9WlIgGeHQ6aHX9uT/ +uFf59QyJL5cE512tVJh58w5g0Z5zTm1df97XKjE/eR7UZ6zrMXBPq/zN9FDdg0vrwx8MCw+FSDv lc+Lyn7+5MJ+s+v8hW4zO5HIk87sER+80XJndDwxWV5npnniyyNu5LlEN7xfpaA0KrP4NZmD2cda px97LndVex76Ftxje/C5/azlP+VKTJiNQ1jazG6OL4DJc1zXZkYwa57R7H8azLmsS4yExhLsY0dk LQB6V5nqUGHGdYy6sOjmlciagOcFUNG5PgycssZXPhWAWW/G8ANas+Btlzuul2s7RQ3mPZ9zZZ6a eF++ht/LUjV4gR9JarsSNInfnYGreutfEF+xpHQclg0AAAAASUVORK5CYII= X-Now-Playing: Heidi Berry's _Love_: "Great Big Silver Key" X-Hashcash: 1:23:130704:politza@hochschule-trier.de::c5qgzIFYU3nKmlnH:00000000000000000000000000000000009iFj X-Hashcash: 1:23:130704:14776@debbugs.gnu.org::vwBWWjAvfpoBUOcA:0000000000000000000000000000000000000002fuFS In-Reply-To: <87ppuyhw32.fsf@hochschule-trier.de> (Andreas Politz's message of "Thu, 04 Jul 2013 23:08:33 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-MailScanner-ID: 1Uuqrw-00056t-BX MailScanner-NULL-Check: 1373577312.79234@Fprt/geSK+ILNGMbBLsjjA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:75920 Archived-At: Andreas Politz writes: >> (benchmark-elapse (dotimes (i 10000) (parse-time-string "Thu, 04 Jul >> 2013 20:06:00 +0200"))) >> => 1.120856647 > > => 0.215108395 > ;-O Wow, that's a pretty impressive speed-up. I do see one issue, though -- it doesn't parse 2-digit years? That's a requirement. Anyway, with this large speed-up, I think we should definitely consider swapping out the current parse-time code with your code. Could you collect a bunch of Date headers from the wild and see whether the old and new versions agree on them all? > It looks that way, i.e. parse-time-string is pretty simple compared to > that. But most Date header I've seen popping up in my mail seem to > adhere to a strict rfc2822 format anyway, except for the occasional > non-strict timezone. Yes, mailers have gotten a lot better about adhering to the RFC2822 date format the last decade. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/