From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.bugs Subject: bug#14776: 24.3.50; [PATCH] parse-time-string performance Date: Thu, 04 Jul 2013 17:41:29 +0200 Message-ID: <87li5m1geu.fsf@hochschule-trier.de> References: <87sizwxwu2.fsf@hochschule-trier.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372952627 13885 80.91.229.3 (4 Jul 2013 15:43:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jul 2013 15:43:47 +0000 (UTC) To: 14776@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 17:43:47 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 1UulhD-00080T-6w for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 17:43:47 +0200 Original-Received: from localhost ([::1]:60604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulhC-0008VV-Si for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2013 11:43:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uulfb-0006WL-9T for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 11:42:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UulfW-0007lh-EE for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 11:42:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulfW-0007ld-A7 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 11:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UulfW-0006FX-3K for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2013 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Politz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2013 15:42:01 +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.137295251323997 (code B ref 14776); Thu, 04 Jul 2013 15:42:01 +0000 Original-Received: (at 14776) by debbugs.gnu.org; 4 Jul 2013 15:41:53 +0000 Original-Received: from localhost ([127.0.0.1]:57512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UulfM-0006Ew-U9 for submit@debbugs.gnu.org; Thu, 04 Jul 2013 11:41:53 -0400 Original-Received: from gateway-b.fh-trier.de ([143.93.54.182]:57913) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UulfK-0006EU-Mc for 14776@debbugs.gnu.org; Thu, 04 Jul 2013 11:41:51 -0400 X-Virus-Scanned: by Amavisd-new + McAfee uvscan + ClamAV [Rechenzentrum Hochschule Trier] Original-Received: from luca (dslb-178-004-172-178.pools.arcor-ip.net [178.4.172.178]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: politza) by gateway-b.fh-trier.de (Postfix) with ESMTPSA id C60B417B4B4 for <14776@debbugs.gnu.org>; Thu, 4 Jul 2013 17:41:30 +0200 (CEST) Original-Received: from localhost ([127.0.0.1] helo=luca) by luca with esmtp (Exim 4.72) (envelope-from ) id 1Uulf0-0006Yh-1s for 14776@debbugs.gnu.org; Thu, 04 Jul 2013 17:41:30 +0200 In-Reply-To: (Glenn Morris's message of "Tue, 02 Jul 2013 23:34:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:75896 Archived-At: Glenn Morris writes: > Glenn Morris wrote: > >> Why is it called 30+ times per article? Naively, seems like a chance for >> a ~ 30x speed-up, compared to the ~ 4x one you seem to achieve. > > Oh, parse-time-string-chars, not parse-time-string. Ignore me. Yes, but I just noticed something different. In my benchmark the unpatched function runs for 41.5s on 100*3000 calls, which comes down to an average of 0.415s per 3000 dates (or articles in a summary buffer displaying parsed dates). This should actually not be very noticeable. But it was. It took gnus ~40s to display this amount of articles and most of it was spend in parse-time-string. After tweaking it (i.e. the patch) it came down to ~10s. Now, looking more closely at the above, non-gnus numbers, this makes no sense. (Though it's appealing to jump to a conclusion, because it appears to be the correct factor.) I should have tested this with -Q. The reason is a customized gc-cons-percentage (0.2) and gc-cons-threshold (67108864). Using the default values shows almost no difference anymore in gnus, i.e. both versions (stock and patched) need around ~10s. I suppose there are various lessons to learn from this endeavour. -ap