From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 05:13:14 2010 Received: (at submit) by debbugs.gnu.org; 23 Sep 2010 09:13:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyhre-0001I7-BZ for submit@debbugs.gnu.org; Thu, 23 Sep 2010 05:13:14 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyhrc-0001I2-9l for submit@debbugs.gnu.org; Thu, 23 Sep 2010 05:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oyhu8-0002Qz-Mn for submit@debbugs.gnu.org; Thu, 23 Sep 2010 05:15:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:49621) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyhu8-0002Qq-Et for submit@debbugs.gnu.org; Thu, 23 Sep 2010 05:15:48 -0400 Received: from [140.186.70.92] (port=60581 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oyhu6-0006dk-Q1 for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 05:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oyhu5-0002Q0-AY for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 05:15:46 -0400 Received: from ppsw-31.csi.cam.ac.uk ([131.111.8.131]:57880) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyhu3-0002PN-Pr; Thu, 23 Sep 2010 05:15:44 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]:62616 helo=Victoria.local) by ppsw-31.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1Oyhu2-0001lE-Ka (Exim 4.72) (return-path ); Thu, 23 Sep 2010 10:15:42 +0100 From: Leo To: bug-gnu-emacs@gnu.org Subject: 23.2; slow ansi-color-apply Date: Thu, 23 Sep 2010 10:15:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Alex Schroeder X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) I have found ansi-color-apply very expensive and slow. To test this, do the following (remove-hook 'eshell-output-filter-functions 'eshell-handle-ansi-color) (add-hook 'eshell-preoutput-filter-functions 'ansi-color-apply) and do something in eshell that can output a large coloured text such as: cd /usr/include; ack time where ack is a single file perl script from http://betterthangrep.com/. The CPU usage should shoot up to very high. The following version (after brief testing) seems to be noticeably faster. (defun ansi-color-apply* (string) "A more efficient implementation of `ansi-color-apply' (which see)." (let ((face (car ansi-color-context)) start end fragment escape-sequence) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) (with-temp-buffer (insert string) (setq start (point-min-marker)) (goto-char start) (while (re-search-forward ansi-color-drop-regexp nil t) (replace-match "")) (goto-char start) ;; Find the next escape sequence. (while (re-search-forward ansi-color-regexp nil t) (setq end (match-beginning 0)) (when face (put-text-property start end 'ansi-color t) (put-text-property start end 'face face)) (setq start (copy-marker (match-end 0))) (setq escape-sequence (match-string 1)) (replace-match "") (setq face (ansi-color-apply-sequence escape-sequence face))) ;; search for the possible start of a new escape sequence (if (re-search-forward "\033" nil t) (setq end (match-beginning 0) fragment (buffer-substring end (point-max))) (setq end (point-max))) ;; if the rest of the string should have a face, put it there (when face (put-text-property start end 'ansi-color t) (put-text-property start end 'face face)) ;; save context (if (or face fragment) (setq ansi-color-context (list face fragment)) (setq ansi-color-context nil)) (buffer-string)))) Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 23 06:51:37 2010 Received: (at submit) by debbugs.gnu.org; 23 Sep 2010 10:51:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyjOq-0001zJ-Ea for submit@debbugs.gnu.org; Thu, 23 Sep 2010 06:51:36 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyjOn-0001zC-Pg for submit@debbugs.gnu.org; Thu, 23 Sep 2010 06:51:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyjRJ-00058r-Rt for submit@debbugs.gnu.org; Thu, 23 Sep 2010 06:54:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:49757) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyjRJ-00058n-P9 for submit@debbugs.gnu.org; Thu, 23 Sep 2010 06:54:09 -0400 Received: from [140.186.70.92] (port=40072 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OyjRI-00035G-A6 for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 06:54:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OyjBv-0001QA-Fa for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 06:38:16 -0400 Received: from lo.gmane.org ([80.91.229.12]:49710) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OyjBv-0001Py-6B for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 06:38:15 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OyjBt-0001iK-4d for bug-gnu-emacs@gnu.org; Thu, 23 Sep 2010 12:38:13 +0200 Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Sep 2010 12:38:13 +0200 Received: from sdl.web by cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Sep 2010 12:38:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Leo Subject: Re: bug#7089: 23.2; slow ansi-color-apply Date: Thu, 23 Sep 2010 11:38:05 +0100 Lines: 48 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4) Cancel-Lock: sha1:A2I97ErAM8FfeAczt7oo/2zmv3I= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) The following version fixed some glitches in setting ansi-color-context. Also I have received an email from Alex that welcomes the improvement. Let me know if I should send a patch in. (defun ansi-color-apply* (string) "A more efficient implementation of `ansi-color-apply' (which see)." (let ((face (car ansi-color-context)) start end fragment escape-sequence) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) (prog1 (with-temp-buffer (insert string) (setq start (point-min-marker)) (goto-char start) (while (re-search-forward ansi-color-drop-regexp nil t) (replace-match "")) (goto-char start) ;; Find the next escape sequence. (while (re-search-forward ansi-color-regexp nil t) (setq end (match-beginning 0)) (when face (put-text-property start end 'ansi-color t) (put-text-property start end 'face face)) (setq start (copy-marker (match-end 0))) (setq escape-sequence (match-string 1)) (replace-match "") (setq face (ansi-color-apply-sequence escape-sequence face))) ;; search for the possible start of a new escape sequence (if (re-search-forward "\033" nil t) (setq fragment (delete-and-extract-region (match-beginning 0) (point-max)))) ;; if the rest of the string should have a face, put it there (when face (put-text-property start (point-max) 'ansi-color t) (put-text-property start (point-max) 'face face)) ;; return the string (buffer-string)) ;; save context; NB: ansi-color-context is buffer-local so set it after ;; return to the original buffer (if (or face fragment) (setq ansi-color-context (list face fragment)) (setq ansi-color-context nil))))) Leo From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 22:34:12 2010 Received: (at 7089) by debbugs.gnu.org; 28 Oct 2010 02:34:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBIJf-0002Lz-Ui for submit@debbugs.gnu.org; Wed, 27 Oct 2010 22:34:12 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBIJe-0002Lu-1R for 7089@debbugs.gnu.org; Wed, 27 Oct 2010 22:34:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQJAOt+yExFxL/T/2dsb2JhbACgSHxywCiFSASSKg X-IronPort-AV: E=Sophos;i="4.58,248,1286164800"; d="scan'208";a="80873265" Received: from 69-196-191-211.dsl.teksavvy.com (HELO pastel.home) ([69.196.191.211]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 27 Oct 2010 22:38:17 -0400 Received: by pastel.home (Postfix, from userid 20848) id A4961A8558; Wed, 27 Oct 2010 22:38:17 -0400 (EDT) From: Stefan Monnier To: Leo Subject: Re: bug#7089: 23.2; slow ansi-color-apply Message-ID: References: Date: Wed, 27 Oct 2010 22:38:17 -0400 In-Reply-To: (Leo's message of "Thu, 23 Sep 2010 11:38:05 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7089 Cc: 7089@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > The following version fixed some glitches in setting ansi-color-context. > Also I have received an email from Alex that welcomes the improvement. > Let me know if I should send a patch in. Yes, a patch would be nice. Also a ChangeLog explaining the change (which should hopefully explain why the new code is faster) would be welcome. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 23:59:29 2010 Received: (at 7089) by debbugs.gnu.org; 28 Oct 2010 03:59:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBJeD-0004H7-Ix for submit@debbugs.gnu.org; Wed, 27 Oct 2010 23:59:29 -0400 Received: from ppsw-52.csi.cam.ac.uk ([131.111.8.152]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PBJeA-0004H2-Hs for 7089@debbugs.gnu.org; Wed, 27 Oct 2010 23:59:27 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from [59.57.34.138] (port=29802 helo=Victoria.local) by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1PBJi8-0002Ni-Es (Exim 4.72) (return-path ); Thu, 28 Oct 2010 05:03:34 +0100 From: Leo To: Stefan Monnier Subject: Re: bug#7089: 23.2; slow ansi-color-apply References: Date: Thu, 28 Oct 2010 12:03:18 +0800 In-Reply-To: (Stefan Monnier's message of "Wed, 27 Oct 2010 22:38:17 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 7089 Cc: 7089@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 2010-10-28 10:38 +0800, Stefan Monnier wrote: >> The following version fixed some glitches in setting ansi-color-context. >> Also I have received an email from Alex that welcomes the improvement. >> Let me know if I should send a patch in. > > Yes, a patch would be nice. Also a ChangeLog explaining the change > (which should hopefully explain why the new code is faster) would > be welcome. > > > Stefan Attached to the end of this message. I basically rewrite ansi-color-apply using re-search-forward (as in ansi-color-apply-on-region) which seems to be an order more efficient than string-match. I have been using the new version in eshell and it is almost as efficient as ansi-color-apply-on-region. It is very painful to use the original ansi-color-apply. Do you know for sure string-match is slower (more CPU intensive) than re-search-forward? Thanks. Leo -------------------------------- >From 724a620dd2d5301c32ecf4fbe6ce539db0c9bc8d Mon Sep 17 00:00:00 2001 Date: Thu, 28 Oct 2010 11:48:13 +0800 Subject: [PATCH] Rewrite ansi-color-apply using re-search-forward to improve efficiency. `string-match' uses a lot of CPU. --- lisp/ChangeLog | 5 ++++ lisp/ansi-color.el | 66 ++++++++++++++++++++++++++------------------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 146c6c9..7088f28 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-10-28 Leo + + * ansi-color.el (ansi-color-apply): Rewrite using + re-search-forward for speed. + 2010-10-03 Chong Yidong * minibuffer.el (completion--some, completion--do-completion) diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 00162c9..6ef55e1 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -314,43 +314,45 @@ This function can be added to `comint-preoutput-filter-functions'. You cannot insert the strings returned into buffers using font-lock. See `ansi-color-unfontify-region' for a way around this." (let ((face (car ansi-color-context)) - (start 0) end escape-sequence result - colorized-substring) + start end fragment escape-sequence) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) - ;; Find the next escape sequence. - (while (setq end (string-match ansi-color-regexp string start)) - (setq escape-sequence (match-string 1 string)) - ;; Colorize the old block from start to end using old face. - (when face - (put-text-property start end 'ansi-color t string) - (put-text-property start end 'face face string)) - (setq colorized-substring (substring string start end) - start (match-end 0)) - ;; Eliminate unrecognized ANSI sequences. - (while (string-match ansi-color-drop-regexp colorized-substring) - (setq colorized-substring - (replace-match "" nil nil colorized-substring))) - (push colorized-substring result) - ;; Create new face, by applying escape sequence parameters. - (setq face (ansi-color-apply-sequence escape-sequence face))) - ;; if the rest of the string should have a face, put it there - (when face - (put-text-property start (length string) 'ansi-color t string) - (put-text-property start (length string) 'face face string)) - ;; save context, add the remainder of the string to the result - (let (fragment) - (if (string-match "\033" string start) - (let ((pos (match-beginning 0))) - (setq fragment (substring string pos)) - (push (substring string start pos) result)) - (push (substring string start) result)) + (prog1 + (with-temp-buffer + (insert string) + (setq start (point-min-marker)) + (goto-char start) + (while (re-search-forward ansi-color-drop-regexp nil t) + (replace-match "")) + (goto-char start) + ;; Find the next escape sequence. + (while (re-search-forward ansi-color-regexp nil t) + (setq end (match-beginning 0)) + (when face + (put-text-property start end 'ansi-color t) + (put-text-property start end 'face face)) + (setq start (copy-marker (match-end 0))) + (setq escape-sequence (match-string 1)) + (replace-match "") + (setq face (ansi-color-apply-sequence escape-sequence face))) + ;; Search for the possible start of a new escape sequence + (if (re-search-forward "\033" nil t) + (setq fragment + (delete-and-extract-region (match-beginning 0) + (point-max)))) + ;; If the rest of the string should have a face, put it there + (when face + (put-text-property start (point-max) 'ansi-color t) + (put-text-property start (point-max) 'face face)) + ;; Return the string + (buffer-string)) + ;; Save context; NB: ansi-color-context is buffer-local so set it after + ;; exit the temp buffer. (if (or face fragment) - (setq ansi-color-context (list face fragment)) - (setq ansi-color-context nil))) - (apply 'concat (nreverse result)))) + (setq ansi-color-context (list face fragment)) + (setq ansi-color-context nil))))) ;; Working with regions -- 1.7.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 31 15:06:17 2010 Received: (at 7089) by debbugs.gnu.org; 31 Oct 2010 19:06:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCdEP-0003HH-Ka for submit@debbugs.gnu.org; Sun, 31 Oct 2010 15:06:17 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCdEN-0003HB-NR for 7089@debbugs.gnu.org; Sun, 31 Oct 2010 15:06:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AskIAG9bzUxFpYZA/2dsb2JhbACgSX5yuWOFRASSKw X-IronPort-AV: E=Sophos;i="4.58,268,1286164800"; d="scan'208";a="81202416" Received: from 69-165-134-64.dsl.teksavvy.com (HELO pastel.home) ([69.165.134.64]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 31 Oct 2010 15:10:33 -0400 Received: by pastel.home (Postfix, from userid 20848) id A1397A8621; Sun, 31 Oct 2010 15:10:32 -0400 (EDT) From: Stefan Monnier To: Leo Subject: Re: bug#7089: 23.2; slow ansi-color-apply Message-ID: References: Date: Sun, 31 Oct 2010 15:10:32 -0400 In-Reply-To: (Leo's message of "Thu, 28 Oct 2010 12:03:18 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 7089 Cc: 7089@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >>> The following version fixed some glitches in setting ansi-color-context. >>> Also I have received an email from Alex that welcomes the improvement. >>> Let me know if I should send a patch in. >> Yes, a patch would be nice. Also a ChangeLog explaining the change >> (which should hopefully explain why the new code is faster) would >> be welcome. > Attached to the end of this message. I basically rewrite > ansi-color-apply using re-search-forward (as in > ansi-color-apply-on-region) which seems to be an order more efficient > than string-match. > I have been using the new version in eshell and it is almost as > efficient as ansi-color-apply-on-region. It is very painful to use the > original ansi-color-apply. Any reason why your new code does something similar to ansi-color-apply-on-region rather than calling ansi-color-apply-on-region? > Do you know for sure string-match is slower (more CPU intensive) than > re-search-forward? They should be largely equivalent. The difference between the two codes might be due to replace-match and substring. I.e. the original ansi-color-apply should be at least as efficient as your code (if not more) in the case where there are no SGR escape sequences. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 01 12:18:58 2010 Received: (at 7089) by debbugs.gnu.org; 1 Nov 2010 16:18:58 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCx62-0005D3-Gk for submit@debbugs.gnu.org; Mon, 01 Nov 2010 12:18:58 -0400 Received: from ppsw-52.csi.cam.ac.uk ([131.111.8.152]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCx60-0005Cy-Mo for 7089@debbugs.gnu.org; Mon, 01 Nov 2010 12:18:57 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from [59.57.34.138] (port=13187 helo=Victoria.local) by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1PCxAB-0004Pk-EK (Exim 4.72) (return-path ); Mon, 01 Nov 2010 16:23:16 +0000 From: Leo To: Stefan Monnier Subject: Re: bug#7089: 23.2; slow ansi-color-apply References: Date: Tue, 02 Nov 2010 00:23:06 +0800 In-Reply-To: (Stefan Monnier's message of "Sun, 31 Oct 2010 15:10:32 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 7089 Cc: 7089@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 2010-11-01 03:10 +0800, Stefan Monnier wrote: >>>> The following version fixed some glitches in setting ansi-color-context. >>>> Also I have received an email from Alex that welcomes the improvement. >>>> Let me know if I should send a patch in. >>> Yes, a patch would be nice. Also a ChangeLog explaining the change >>> (which should hopefully explain why the new code is faster) would >>> be welcome. > >> Attached to the end of this message. I basically rewrite >> ansi-color-apply using re-search-forward (as in >> ansi-color-apply-on-region) which seems to be an order more efficient >> than string-match. > >> I have been using the new version in eshell and it is almost as >> efficient as ansi-color-apply-on-region. It is very painful to use the >> original ansi-color-apply. > > Any reason why your new code does something similar to > ansi-color-apply-on-region rather than calling > ansi-color-apply-on-region? `ansi-color-apply-on-region' uses overlays while `ansi-color-apply' uses text properties. >> Do you know for sure string-match is slower (more CPU intensive) than >> re-search-forward? > > They should be largely equivalent. The difference between the two > codes might be due to replace-match and substring. I.e. the original > ansi-color-apply should be at least as efficient as your code (if not > more) in the case where there are no SGR escape sequences. > > > Stefan Thanks for that info. Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 25 09:25:52 2010 Received: (at 7089-done) by debbugs.gnu.org; 25 Nov 2010 14:25:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLcld-0000qH-MP for submit@debbugs.gnu.org; Thu, 25 Nov 2010 09:25:52 -0500 Received: from ppsw-50.csi.cam.ac.uk ([131.111.8.150]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLclV-0000q0-Vr for 7089-done@debbugs.gnu.org; Thu, 25 Nov 2010 09:25:44 -0500 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]:49640 helo=Victoria.local) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1PLcqe-0001ac-sK (Exim 4.72) (return-path ); Thu, 25 Nov 2010 14:31:00 +0000 From: Leo To: Stefan Monnier Subject: Re: bug#7089: 23.2; slow ansi-color-apply References: Date: Thu, 25 Nov 2010 14:30:54 +0000 In-Reply-To: (Stefan Monnier's message of "Sun, 31 Oct 2010 15:10:32 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.5) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Debbugs-Envelope-To: 7089-done Cc: 7089-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org --=-=-= On 2010-10-31 19:10 +0000, Stefan Monnier wrote: >> Do you know for sure string-match is slower (more CPU intensive) than >> re-search-forward? > > They should be largely equivalent. The difference between the two codes > might be due to replace-match and substring. I.e. the original > ansi-color-apply should be at least as efficient as your code (if not > more) in the case where there are no SGR escape sequences. > > > Stefan I was setting out to profile the two versions of the function and unfortunately I was not able to see the CPU shootup mentioned in the first message. My result shows my version of ansi-color-apply is almost twice as slow as the original one. (The code and data used for profiling are attached.) So please ignore this bug report. Leo --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=ansi-color-test.el Content-Transfer-Encoding: quoted-printable Content-Description: ansi-color-test.el ;; (let ((txt (with-current-buffer "ansi-test.txt" (buffer-string)))) ;; (list (time (dotimes (_ 20) (ansi-color-apply txt))) ;; (time (dotimes (_ 20) (ansi-color-apply2 txt))))) (require 'ansi-color) (defmacro time (&rest forms) `(let ((t1 (float-time))) (progn ,@forms) (- (float-time) t1))) ;;; original version (defun ansi-color-apply (string) (let ((face (car ansi-color-context)) (start 0) end escape-sequence result colorized-substring) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) ;; Find the next escape sequence. (while (setq end (string-match ansi-color-regexp string start)) (setq escape-sequence (match-string 1 string)) ;; Colorize the old block from start to end using old face. (when face (put-text-property start end 'ansi-color t string) (put-text-property start end 'face face string)) (setq colorized-substring (substring string start end) start (match-end 0)) ;; Eliminate unrecognized ANSI sequences. (while (string-match ansi-color-drop-regexp colorized-substring) (setq colorized-substring (replace-match "" nil nil colorized-substring))) (push colorized-substring result) ;; Create new face, by applying escape sequence parameters. (setq face (ansi-color-apply-sequence escape-sequence face))) ;; if the rest of the string should have a face, put it there (when face (put-text-property start (length string) 'ansi-color t string) (put-text-property start (length string) 'face face string)) ;; save context, add the remainder of the string to the result (let (fragment) (if (string-match "\033" string start) (let ((pos (match-beginning 0))) (setq fragment (substring string pos)) (push (substring string start pos) result)) (push (substring string start) result)) (if (or face fragment) (setq ansi-color-context (list face fragment)) (setq ansi-color-context nil))) (apply 'concat (nreverse result)))) ;;; my version (defun ansi-color-apply2 (string) (let ((face (car ansi-color-context)) start end fragment escape-sequence) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) (prog1 (with-temp-buffer (insert string) (setq start (point-min-marker)) (goto-char start) (while (re-search-forward ansi-color-drop-regexp nil t) (replace-match "")) (goto-char start) ;; Find the next escape sequence. (while (re-search-forward ansi-color-regexp nil t) (setq end (match-beginning 0)) (when face (put-text-property start end 'ansi-color t) (put-text-property start end 'face face)) (setq start (copy-marker (match-end 0))) (setq escape-sequence (match-string 1)) (replace-match "") (setq face (ansi-color-apply-sequence escape-sequence face))) ;; Search for the possible start of a new escape sequence (if (re-search-forward "\033" nil t) (setq fragment (delete-and-extract-region (match-beginning 0) (point-max)))) ;; If the rest of the string should have a face, put it there (when face (put-text-property start (point-max) 'ansi-color t) (put-text-property start (point-max) 'face face)) ;; Return the string (buffer-string)) ;; Save context; NB: ansi-color-context is buffer-local so set it aft= er ;; exit the temp buffer. (if (or face fragment) (setq ansi-color-context (list face fragment)) (setq ansi-color-context nil))))) --=-=-= Content-Disposition: attachment; filename=ansi-test.txt Content-Transfer-Encoding: 8bit Content-Description: ansi-test.txt AssertMacros.h 1198: * any build: if the expression is not true, generated a compile time error. 1203: * The compile time expression that should evaluate to non-zero. 1206: * This declares an array with a size that is determined by a compile-time expression. 1207: * If false, it declares a negatively sized array, which generates a compile-time error. 1214: * Note: This only works with compile-time expressions. 1220: extern int compile_time_assert_failed[ ( expr ) ? 1 : -1 ] __attribute__( ( unused ) ) 1223: extern int compile_time_assert_failed[ ( expr ) ? 1 : -1 ] 1228: * For time immemorial, Mac OS X has defined version of most of these macros without the __ prefix, which 1277: replace "check_compile_time()" with "__Check_Compile_Time()" \ 1417: #ifndef check_compile_time 1418: #define check_compile_time( expr ) __Check_Compile_Time( expr ) AvailabilityMacros.h 31: This header enables a developer to specify build time 40: be weak-importing (allowed to be unresolved at launch time). CommonCrypto/CommonCryptor.h 71: A given CCCryptor can only be used by one thread at a time; 73: same time.  390: @discussion This routine can be called multiple times. The caller does 583: operation can be retried with minimal runtime  CommonCrypto/CommonHMAC.h 93: @discussion This can be called multiple times. DNSServiceDiscovery/DNSServiceDiscovery.h 285: @param ttl time to live for the added record. 297: @param ttl time to live for the updated record. FlexLexer.h 105:// Either this is the first time through (yyFlexLexerOnce not defined), NSSystemDirectories.h 97: Call NSStartSearchPathEnumeration() once, then call NSGetNextSearchPathEnumeration() one or more times with the returned state. 98: The return value of NSGetNextSearchPathEnumeration() should be used as the state next time around. TargetConditionals.h 67: These conditionals specify in which runtime the generated code will 68: run. This is needed when the OS and CPU support more than one runtime 75: TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used _types.h 32:#define __strftimelike(fmtarg) \ 33: __attribute__((__format__ (__strftime__, fmtarg, 0))) 36:#define __strftimelike(fmtarg) apache2/ap_config.h 47: * conventions at compile time. 83: * This assures the appropriate indirection is invoked at compile time. 111: * Unless AP_MODULE_DECLARE_STATIC is defined at compile time, symbols  127: * AP_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined. 129: * The old SHARED_MODULE compile-time symbol is now the default behavior,  apache2/ap_config_auto.h 173:/* Define to 1 if you have the header file. */ 176:/* Define to 1 if you have the header file. */ 185:/* Define to 1 if you have the `timegm' function. */ 188:/* Define to 1 if you have the `times' function. */ apache2/ap_mmn.h 77: * 20020612 (2.0.38-dev) Changed server_rec->[keep_alive_]timeout to apr time 131: * 20051115.16 (2.2.9) Add conn_timeout and conn_timeout_set to 135: * 20051115.19 (2.2.11) Added ap_timeout_parameter_parse to util.c / httpd.h 136: * 20051115.20 (2.2.11) Add ap_proxy_buckets_lifetime_transform to mod_proxy.h apache2/ap_mpm.h 73: But the preferred method of handling timeouts is to use the 74: timeouts provided by the BUFF abstraction. 167: * because the profile itimers and such are disabled across a apache2/http_config.h 52: ITERATE, /**< one argument, occuring multiple times 55: ITERATE2, /**< two arguments, 2nd occurs multiple times 564: * @param p The pool of the same lifetime as the module 580: * @param p The pool with the same lifetime as the module 818: * @param p The pool valid for the lifetime of the module apache2/http_connection.h 47: * Most times this will be a socket, but it is up to the module 89: * needs to be unique at that time, not forever. 104: * Most times this will be a socket, but it is up to the module apache2/http_core.h 35:#include  124:/** Make sure we don't write less than 8000 bytes at any one time. 539: * Run-time performance tuning 621: * Runtime status/management apache2/http_protocol.h 121: * Return the latest rational time from a request/mtime pair. Mtime is  122: * returned unless it's in the future, in which case we return the current time. 124: * @param mtime The last modified time 125: * @return the latest rational time. 127:AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime); 168: * Set the last modified time for the file being sent 186: * underneath the main body of the code later. In the meantime, it lets 190: * They should only be called with a timeout registered, for obvious reaasons. 442: * itself the next time, if an authentication request failed. This function 450: * itself the next time, if an authentication request failed. This function 458: * itself the next time, if an authentication request failed. This function apache2/http_request.h 193: * Function to set the r->mtime field to the specified value if it's later 196: * @param dependency_mtime Time to set the mtime to 198:AP_DECLARE(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime); 203: * sent, but sometimes invoked at an earlier phase if a module knows it 220: * sent, but sometimes invoked at an earlier phase if a module knows it apache2/http_vhost.h 41: * the run-time vhost lookups apache2/httpd.h 52:#include "apr_time.h" 161:/** The timeout for waiting for messages */ 166:/** The timeout for waiting for keepalive timeout until next request */ 464: * Get the date a time that the server was built 465: * @return The server build time string 815: apr_time_t request_time; 861: /** Last modified time of the requested resource */ 862: apr_time_t mtime; 1004: * record to improve 64bit alignment the next time we need to break 1014: * grouped together as just "proxied", but sometimes it's necessary to 1073: /** How many times have we used it? */ 1081: /** ID of this connection; unique at any point in time */ 1121: /** APR_RING of expiration timeouts */ 1122: APR_RING_ENTRY(conn_state_t) timeout_list; 1123: /** the expiration time of the next keepalive timeout */ 1124: apr_time_t expiration_time; 1209: apr_interval_time_t timeout; 1211: apr_interval_time_t keep_alive_timeout; 1272: * Convert a time from an integer into a string in a specified format 1274: * @param t The time to convert 1276: * @param gmt Convert the time for GMT? 1277: * @return The string that represents the specified time 1279:AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt); 1738: * Parse a given timeout parameter string into an apr_interval_time_t value. 1739: * The unit of the time interval is given as postfix string to the numeric 1747: * If no unit is contained in the given timeout parameter the default_time_unit 1749: * @param timeout_parameter The string containing the timeout parameter. 1750: * @param timeout The timeout value to be returned. 1751: * @param default_time_unit The default time unit to use if none is specified 1752: * in timeout_parameter. 1755:AP_DECLARE(apr_status_t) ap_timeout_parameter_parse( 1756: const char *timeout_parameter, 1757: apr_interval_time_t *timeout, 1758: const char *default_time_unit); apache2/mod_dav.h 39:#include <time.h> /* for time_t */ 380: following pool should be used. Its lifetime will be at least as 495:/* format a time string (buf must be at least DAV_TIMEBUF_SIZE chars) */ 532:/* add a specific prefix/URI pair. the prefix/uri should have a lifetime 538: the uri should have a lifetime at least that xmlns->pool */ 932:** alphabetically, and may be reordered from time to time (as properties 1042: ** Note: sometimes mod_dav will defer calling this until output_value 1093: ** ### element structure (a second time will quote it again). 1110: ** Note: only one iteration may occur over the propdb at a time. 1143:DAV_DECLARE(time_t) dav_get_timeout(request_rec *r); 1225: time_t timeout; /* when the lock will timeout */ 1417: ** WARNING: this function may return TRUE even when timed-out locks 1418: ** exist (i.e. it may not perform timeout checks). 1462: time_t new_time, 1550:** can sometimes fail(!). apache2/mod_dbd.h 76:/* acquire a connection that will have the lifetime of a request 82:/* acquire a connection that will have the lifetime of a connection apache2/mod_include.h 94: /* currently configured time format */ 95: const char *time_str; apache2/mod_log_config.h 68: * you should probably set the writer at the same time (ie..before open_logs) apache2/mod_perl.h 71:#include "modperl_time.h" apache2/mod_proxy.h 177: apr_interval_time_t timeout; 178: char timeout_set; 290:/* default worker retry timeout in seconds */ 294:/* Runtime worker status informations. Shared in scoreboard */ 297: apr_time_t error_time; /* time of the last error */ 303: apr_size_t elected; /* Number of times the worker was elected */ 314: apr_interval_time_t retry; /* retry interval */ 326: apr_interval_time_t ttl; /* maximum amount of time in seconds a connection 328: apr_interval_time_t timeout; /* connection timeout */ 329: char timeout_set; 330: apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */ 351: int flush_wait; /* poll wait time in microseconds if flush_auto */ 353: apr_interval_time_t ping_timeout; 354: char ping_timeout_set; 358: apr_interval_time_t conn_timeout; 359: char conn_timeout_set; 373: apr_interval_time_t timeout; /* Timeout for waiting on free connection */ 458: * It is called after request for updating runtime balancer status. 679: * @note Worker will be marker for retry if the time of the last retry 694: * block untill the timeout is reached. 773:ap_proxy_buckets_lifetime_transform(request_rec *r, apr_bucket_brigade *from, apache2/modperl_apr_includes.h 33:#include "apr_time.h" apache2/modperl_filter.h 110:void modperl_filter_runtime_add(pTHX_ request_rec *r, conn_rec *c, apache2/modperl_time.h 28: struct tms start_time; \ 29: struct tms end_time 35: MP_TRACE_t_do((void)PerlProc_times(&start_time)) 38: MP_TRACE_t_do((void)PerlProc_times(&end_time)) 42: double utime = \ 43: (double)(end_time.tms_utime - start_time.tms_utime)/MP_HZ; \ 44: double stime = \ 45: (double)(end_time.tms_stime - start_time.tms_stime)/MP_HZ; \ 46: if (utime || stime) { \ 48: label, utime, stime); \ apache2/modperl_trace.h 158:modperl_trace(NULL, " r %s (Perl runtime interaction)", (MP_debug_level & 1024) ? "On " : "Off"); \ apache2/modperl_types.h 70: * r == runtime grow apache2/modperl_util.h 143:/* functions maintaining the amount of times mod_perl was restarted, apache2/modperl_xs_sv_convert.h 64:#define mp_xs_sv2_apr_time_t(sv) (apr_time_t)SvNV(sv) 252:#define mp_xs_sv2_apr_interval_time_t(sv) (apr_interval_time_t)SvNV(sv) 380:#define mp_xs_sv2_time_t(sv) (time_t)SvNV(sv) 409:INT2PTR(apr_time_exp_t *, SvIV((SV*)SvRV(sv))) : (apr_time_exp_t *)NULL) apache2/modperl_xs_typedefs.h 62:typedef apr_time_exp_t * APR__ExplodedTime; apache2/modperl_xs_util.h 120: /* sometimes the added magic is the second one (e.g. in case when apache2/mpm_common.h 88: * each time through the loop. If 0, give the process time to die 162: * this process sleeps for the amount of time specified by the MPM defined 169:void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret,  177: * @param status The status returned from ap_wait_or_timeout 231: * processes that it is time to die gracefully. 326: * Set the timeout period for a graceful shutdown. 329:extern int ap_graceful_shutdown_timeout; 334: RSRC_CONF, "Maximum time in seconds to wait for child " \ apache2/scoreboard.h 30:#include  31:#include  33:#include <time.h> 45:#define DEFAULT_SCOREBOARD "logs/apache_runtime_status" 74: * created at config time in the parent are valid across children. However, 121: apr_time_t start_time; 122: apr_time_t stop_time; 124: struct tms times; 126: apr_time_t last_used; 139: apr_time_t restart_time; 190:void ap_time_process_request(ap_sb_handle_t *sbh, int status); 221:/* for time_process_request() in http_main.c */ apache2/unixd.h 32:#include  apache2/util_filter.h 111: * provided here, so that a filter may be installed multiple times, each 189: * This is the request-time context structure for an installed filter (in apache2/util_ldap.h 30:#include "apr_time.h" apache2/util_time.h 18: * @file util_time.h 19: * @brief Apache date-time handling functions 21: * @defgroup APACHE_CORE_TIME Date-time handling functions 30:#include "apr_time.h" 37:/* Maximum delta from the current time, in seconds, for a past time 44: * convert a recent time to its human readable components in local timezone 45: * @param tm the exploded time 46: * @param t the time to explode: MUST be within the last 48: * @note This is a faster alternative to apr_time_exp_lt that uses 49: * a cache of pre-exploded time structures. It is useful for things 50: * that need to explode the current time multiple times per second, 54:AP_DECLARE(apr_status_t) ap_explode_recent_localtime(apr_time_exp_t *tm, 55: apr_time_t t); 58: * convert a recent time to its human readable components in GMT timezone 59: * @param tm the exploded time 60: * @param t the time to explode: MUST be within the last 62: * @note This is a faster alternative to apr_time_exp_gmt that uses 63: * a cache of pre-exploded time structures. It is useful for things 64: * that need to explode the current time multiple times per second, 68:AP_DECLARE(apr_status_t) ap_explode_recent_gmt(apr_time_exp_t *tm, 69: apr_time_t t); 73: * format a recent timestamp in the ctime() format. 75: * @param t the time to convert  77:AP_DECLARE(apr_status_t) ap_recent_ctime(char *date_str, apr_time_t t); 80: * format a recent timestamp in the RFC822 format 82: * @param t the time to convert  84:AP_DECLARE(apr_status_t) ap_recent_rfc822_date(char *date_str, apr_time_t t); apr-1/apr.h 37: * @defgroup APR Apache Portability Runtime library 443: * This assures the appropriate indirection is invoked at compile time. apr-1/apr_buckets.h 70: * singleton buckets can occur for short periods of time. 90: * lifetime. Sometimes it is convenient to create a bucket referring 108: * don't write too little data at one time. Currently we ignore compacting the 184: * transform the data to have the proper lifetime. 217: * their lifetime is controlled by the parent apr_bucket_brigade 220: * the same lifetime as the bucket and is freed when the bucket is 676: * you wish to reuse many times by destroying all of the buckets in 928: * @warning The allocator must never be used by more than one thread at a time. 938: * @warning The allocator must never be used by more than one thread at a time. 1043: * @param pool The pool defining the desired lifetime of the bucket data 1053: * @param pool The pool defining the desired lifetime of the bucket data apr-1/apr_date.h 36:#include "apr_time.h" 43:#define APR_DATE_BAD ((apr_time_t)0) 67: * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format 70: * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or 73:APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date); 85: * Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format 96: * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or 99:APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date); apr-1/apr_dbm.h 64: * @param type The type of the DBM (not all may be available at run time) apr-1/apr_errno.h 62: * multiple times. 72: * multiple times. If the statcode was not created by apr_get_os_error  89: * multiple times. If the statcode was not created by apr_get_os_error 106: * multiple times. If the statcode was not created by apr_get_os_error 146: * error immediately following this one is set ten times farther 234: * APR_ENOTIME APR was not given a time structure 259: * APR_TIMEUP The operation did not finish before the timeout 370:/** APR was not given a time structure */ 527: * The operation did not finish before the timeout 902:#define SOCETIMEDOUT (SOCBASEERR+60) /* Connection timed out */ 1284:/** Operation timed out apr-1/apr_file_info.h 29:#include "apr_time.h" 147:#define APR_FINFO_CTIME 0x00000020 /**< Creation or inode-changed time */ 163:#define APR_FINFO_MIN 0x00008170 /**< type, mtime, ctime, atime, size */ 201: /** The time the file was last accessed */ 202: apr_time_t atime; 203: /** The time the file was last modified */ 204: apr_time_t mtime; 205: /** The time the file was created, or the inode was last changed */ 206: apr_time_t ctime; apr-1/apr_file_io.h 27:#include "apr_time.h" 184: at any given time. Essentially, 190: given time. This is analogous to 652: * Create an anonymous pipe which portably supports async timeout options. 687: * Get the timeout value for a pipe or manipulate the blocking state. 688: * @param thepipe The pipe we are getting a timeout for. 689: * @param timeout The current timeout value in microseconds.  691:APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe,  692: apr_interval_time_t *timeout); 695: * Set the timeout value for a pipe or manipulate the blocking state. 696: * @param thepipe The pipe we are setting a timeout on. 697: * @param timeout The timeout value in microseconds. Values < 0 mean wait  700:APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe,  701: apr_interval_time_t timeout); 802: * Set the mtime of the specified file. 804: * @param mtime The mtime to apply to the file. 809:APR_DECLARE(apr_status_t) apr_file_mtime_set(const char *fname, 810: apr_time_t mtime, apr-1/apr_hash.h 128: * progress at the same time. apr-1/apr_ldap.h 133: * In the mean time, please use an LDAP v3.0 toolkit. apr-1/apr_ldap_option.h 84: * time. Three types are supported: APR_LDAP_CERT7_DB, APR_LDAP_KEY3_DB and 95: * time. Three types are supported: APR_LDAP_CA*, APR_LDAP_CERT* and 102: * Clients certs and keys are set at system initialisation time with 113: * Needs one or more CA certificates to be set at system initialisation time apr-1/apr_memcache.h 30:#include "apr_time.h" 74: apr_time_t btime; 212: * @param ttl time to live in seconds of a client connection 290: * @param timeout time in seconds for the data to live on the server 297: apr_uint32_t timeout, 306: * @param timeout time for the data to live on the server 315: apr_uint32_t timeout, 324: * @param timeout time for the data to live on the server 333: apr_uint32_t timeout, 339: * @param timeout time for the delete to stop other clients from adding 343: apr_uint32_t timeout); 387: apr_uint32_t uptime; 388: /** current UNIX time according to the server */ 389: apr_time_t time; 392: /** Accumulated user time for this process */ 393: apr_time_t rusage_user; 394: /** Accumulated system time for this process */ 395: apr_time_t rusage_system; 417: expiration time */ apr-1/apr_network_io.h 82: * (timeout != 0) on which the 465: * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK 485: * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK 541: * this behavior, use apr_socket_timeout_set() or the 565: * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK 604: * Setup socket timeout for the specified socket 606: * @param t Value for the timeout. 608: * t > 0 -- read and write calls return APR_TIMEUP if specified time 614:APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock, 615: apr_interval_time_t t); 640: * Query socket timeout for the specified socket 642: * @param t Socket timeout returned from the query. 644:APR_DECLARE(apr_status_t) apr_socket_timeout_get(apr_socket_t *sock,  645: apr_interval_time_t *t); apr-1/apr_poll.h 160: * @param timeout The amount of time in microseconds to wait. This is  162: * will wake up before this time. A negative number means  168: apr_interval_time_t timeout, 178: * @param timeout The amount of time in microseconds to wait. This is  180: * will wake up before this time. A negative number means  184: * descriptor has been signalled, or the timeout has expired.  190: apr_interval_time_t timeout); 242: * @param timeout The amount of time in microseconds to wait. This is  244: * will wake up before this time. A negative number means  250: apr_interval_time_t timeout, apr-1/apr_pools.h 106: * | | | | | | x | | | Lifetime checking. On each use of a 107: * pool, check its lifetime. If the pool 489: * (using apr_pool_join) to have a lifetime at least as long as some 521: * subpools is okay) at all times. Careful namespace prefixing of 683: * pools have nested lifetimes -- sub_pools are destroyed when the 708: * However, sometimes this ancestor requirement is inconvenient -- 709: * sometimes it's necessary to create a sub pool where the sub pool is 710: * guaranteed to have the same lifetime as the parent pool. This is a 724: * Guarantee that a subpool has the same lifetime as the parent. apr-1/apr_portable.h 36:#include "apr_time.h" 69:typedef FILETIME apr_os_imp_time_t; 70:typedef SYSTEMTIME apr_os_exp_time_t; 82:typedef struct timeval apr_os_imp_time_t; 83:typedef struct tm apr_os_exp_time_t; 103:typedef struct timeval apr_os_imp_time_t; 104:typedef struct tm apr_os_exp_time_t; 116:typedef struct timeval apr_os_imp_time_t; 117:typedef struct tm apr_os_exp_time_t; 157:typedef struct timeval apr_os_imp_time_t; /**< native timeval */ 158:typedef struct tm apr_os_exp_time_t; /**< native tm */ 252: * Get the exploded time in the platforms native format. 253: * @param ostime the native time format 254: * @param aprtime the time to convert 256:APR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime, 257: apr_time_exp_t *aprtime); 260: * Get the imploded time in the platforms native format. 261: * @param ostime the native time format 262: * @param aprtime the time to convert 264:APR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime,  265: apr_time_t *aprtime); 418: * Put the imploded time in the APR format. 419: * @param aprtime the APR time format 420: * @param ostime the time to convert 423:APR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime, 424: apr_os_imp_time_t **ostime, 428: * Put the exploded time in the APR format. 429: * @param aprtime the APR time format 430: * @param ostime the time to convert 433:APR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime, 434: apr_os_exp_time_t **ostime, apr-1/apr_queue.h 25: * Although condition variables are some times available without threads. apr-1/apr_reslist.h 29:#include "apr_time.h" 76: * @param ttl If non-zero, sets the maximum amount of time a resource 88: * double free situations. That is because by the time destructor is 96: apr_interval_time_t ttl, 130: * Set the timeout the acquire will wait for a free resource 133: * @param timeout Timeout to wait. The zero waits forewer. 135:APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist, 136: apr_interval_time_t timeout); apr-1/apr_support.h 40: * Wait for IO to occur or timeout. 46: * @return APR_TIMEUP if we run out of time. 48:apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s, apr-1/apr_tables.h 440: * Except that it is more efficient (less space and cpu-time) especially apr-1/apr_thread_cond.h 28:#include "apr_time.h" 82: * the timeout is reached. Each condition variable must be associated 91: * @param timeout The amount of time in microseconds to wait. This is  93: * will wake up before this time, otherwise the error APR_TIMEUP 96:APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, 98: apr_interval_time_t timeout); apr-1/apr_thread_pool.h 107: * @param time Time in microseconds 114: apr_interval_time_t time, 216: * @return Number of idle threads that timed out 219: apr_thread_pool_threads_idle_timeout_count(apr_thread_pool_t * me); 238: * Access function for the maximum wait time (in microseconds) of an 241: * over time. Which helps reduce thrashing. 243: * @param timeout The number of microseconds an idle thread should wait 245: * @return The original maximum wait time 247:APU_DECLARE(apr_interval_time_t) 249: apr_interval_time_t timeout); 252: * Access function for the maximum wait time (in microseconds) of an 255: * @return The current maximum wait time 257:APU_DECLARE(apr_interval_time_t) apr-1/apr_thread_proc.h 31:#include  185:/** Opaque control variable for one-time atomic variables. */ 300: * Run the specified function one time, regardless of how many threads 303: * be passed in each time the function is tried to be 525: * @remark At the present time, it will only be called from apr_proc_create() 774: * @param a The pool to use to define the processes lifetime  apr-1/apr_time.h 21: * @file apr_time.h 34: * @defgroup apr_time Time Routines 46:typedef apr_int64_t apr_time_t; 49:/** mechanism to properly type apr_time_t literals */ 52:/** mechanism to properly print apr_time_t values */ 55:/** intervals for I/O timeouts, in microseconds */ 56:typedef apr_int64_t apr_interval_time_t; 57:/** short interval for I/O timeouts, in microseconds */ 58:typedef apr_int32_t apr_short_interval_time_t; 63:/** @return apr_time_t as a second */ 64:#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC) 66:/** @return apr_time_t as a usec */ 67:#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) 69:/** @return apr_time_t as a msec */ 70:#define apr_time_msec(time) (((time) / 1000) % 1000) 72:/** @return apr_time_t as a msec */ 73:#define apr_time_as_msec(time) ((time) / 1000) 75:/** @return a second as an apr_time_t */ 76:#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC) 78:/** @return a second and usec combination as an apr_time_t */ 79:#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \ 80: + (apr_time_t)(usec)) 83: * @return the current time 85:APR_DECLARE(apr_time_t) apr_time_now(void); 87:/** @see apr_time_exp_t */ 88:typedef struct apr_time_exp_t apr_time_exp_t; 95:struct apr_time_exp_t { 114: /** daylight saving time */ 121: * convert an ansi time_t to an apr_time_t 122: * @param result the resulting apr_time_t 123: * @param input the time_t to convert 125:APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result,  126: time_t input); 129: * convert a time to its human readable components using an offset 131: * @param result the exploded time 132: * @param input the time to explode 135:APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result, 136: apr_time_t input, 140: * convert a time to its human readable components in GMT timezone 141: * @param result the exploded time 142: * @param input the time to explode 144:APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result,  145: apr_time_t input); 148: * convert a time to its human readable components in local timezone 149: * @param result the exploded time 150: * @param input the time to explode 152:APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,  153: apr_time_t input); 156: * Convert time value from human readable format to a numeric apr_time_t  158: * @param result the resulting imploded time 159: * @param input the input exploded time 161:APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result,  162: apr_time_exp_t *input); 165: * Convert time value from human readable format to a numeric apr_time_t that 167: * @param result the resulting imploded time 168: * @param input the input exploded time 170:APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result,  171: apr_time_exp_t *input); 175: * @param t desired amount of time to sleep. 176: * @warning May sleep for longer than the specified time.  178:APR_DECLARE(void) apr_sleep(apr_interval_time_t t); 188: * @param t the time to convert  190:APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t); 195: * apr_ctime formats dates in the ctime() format 199: * Unlike ANSI/ISO C ctime(), apr_ctime() does not include 202: * @param t the time to convert  204:APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t); 207: * formats the exploded time according to the format specified 211: * @param format The format for the time string 212: * @param tm The time to convert 214:APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,  216: apr_time_exp_t *tm); 219: * Improve the clock resolution for the lifetime of the given pool. 221: * time-sensitive applications, and has no impact on most platforms. 224:APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p); apr-1/apr_version.h 32: * compiled against a different version of APR by use of the compile-time 33: * constants and the use of the run-time query function. 41:/* The numeric compile-time version constants. These constants are the 72: * Check at compile time if the APR version is at least a certain 119:/* The C language API to access the version at run time,  120: * as opposed to compile time. APR_VERSION_ONLY may be defined  apr-1/apr_want.h 101: * now to ensure that our struct is not introduced several times. apr-1/apr_xlate.h 50: * compile time. This is useful if there are literal 55: * APR at compile time. 72: * This is to indicate the charset of the sourcecode at compile time 74: * compile time. This is useful if there are literal 127: * at a time. This needs to be written carefully so that it works apr-1/apu.h 42: * conventions at compile time. 62: * This assures the appropriate indirection is invoked at compile time. 74: * Unless APU_MODULE_DECLARE_STATIC is defined at compile time, symbols  apr-1/apu_version.h 32: * compiled against a different version of APU by use of the compile-time 33: * constants and the use of the run-time query function. 41:/* The numeric compile-time version constants. These constants are the 103:/* The C language API to access the version at run time,  104: * as opposed to compile time. APU_VERSION_ONLY may be defined  ar.h 58: char ar_date[12]; /* modification time */ architecture/i386/fenv.h 259:* atomic -- that is, for a brief period of time during the function call * architecture/i386/math.h 45: define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler architecture/ppc/math.h 61: define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler 728: * s_lib_version.c) during compile time, it cannot be modified asl.h 113:#define ASL_KEY_TIME_NSEC "TimeNanoSec" /* Nanosecond time. */ 124:#define ASL_KEY_EXPIRE_TIME "ASLExpireTime" /* Expiration time for messages with long TTL. */ assert.h 49: * multiple times, with and without NDEBUG defined. bsm/audit_filter.h 40: * receipt time 42: * with receipt time 50:typedef void (*audit_filter_record_t)(void *instance, struct timespec *ts, 52:typedef void (*audit_filter_rawrecord_t)(void *instance, struct timespec *ts, bsm/audit_kevents.h 215:#define AUE_STIME 201 /* XXXRW: Solaris old stime? */ 216:#define AUE_UTIME 202 /* XXXRW: Solaris old utime? */ bsm/audit_record.h 35:#include /* struct timeval */ 196:token_t *au_to_file(const char *file, struct timeval tm); 199: struct timeval tm); 201: struct timeval tm, struct auditinfo_addr *aia); 203: struct timeval tm); bsm/libbsm.h 44:#include <time.h> /* Required for clock_t on Linux. */ 262: * seconds of time 4 bytes 263: * milliseconds of time 4 bytes 289: * seconds of time 4 bytes/8 bytes (32-bit/64-bit value) 290: * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) 308: * seconds of time 4 bytes/8 bytes (32/64-bits) 309: * nanoseconds of time 4 bytes/8 bytes (32/64-bits) 776:int getacexpire(int *andflg, time_t *age, size_t *size); 1230: * time. A pointer parameter may be NULL if that information is not c++/4.0.0/bits/basic_string.h 1495: * time. 2332: * Exchanges the contents of @a lhs and @a rhs in constant time. c++/4.0.0/bits/boost_concept_check.h 57:// as possible at runtime, use as few resources as possible, and hopefully 67:// Unfortunately, this results in a link-time error, not a compile-time error. c++/4.0.0/bits/cpp_type_traits.h 46:// This file provides some compile-time information about various types. 53:// Firstly, these compile-time entities are used as template-arguments 54:// so function return values won't work: We need compile-time entities. 56:// Secondly, from the point of view of ease of use, type-based compile-time c++/4.0.0/bits/functexcept.h 77: __throw_runtime_error(const char* __s) __attribute__((__noreturn__)); c++/4.0.0/bits/ios_base.h 54: // expressions involving them are no longer compile-time constants. 707: * This function returns a unique integer every time it is called. It c++/4.0.0/bits/locale_classes.h 60: * as money, time, and number printing. 97: * The standard category values are none, ctype, numeric, collate, time, 109: static const category time = 1L << 3; 113: time | monetary | messages); 141: * @throw std::runtime_error if s is null or an undefined locale. 156: * @throw std::runtime_error if s is null or an undefined locale. 210: * @throw std::runtime_error if other has no facet of type Facet. 301: // collate, ctype, monetary, numeric, time, and messages. These 338: * money, time, and number printing. It provides common support for facets 501: static const locale::id* const _S_id_time[]; c++/4.0.0/bits/locale_facets.h 45:#include // For struct tm 1497: // For use at construction time only. 1863: // For use at construction time only. 2674: class time_base 2681: struct __timepunct_cache : public locale::facet 2683: // List of all known timezones, with GMT first. 2684: static const _CharT* _S_timezones[14]; 2688: const _CharT* _M_time_format; 2689: const _CharT* _M_time_era_format; 2690: const _CharT* _M_date_time_format; 2691: const _CharT* _M_date_time_era_format; 2744: __timepunct_cache(size_t __refs = 0) : facet(__refs), 2745: _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL), 2746: _M_time_era_format(NULL), _M_date_time_format(NULL), 2747: _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL), 2761: ~__timepunct_cache(); 2767: __timepunct_cache& 2768: operator=(const __timepunct_cache&); 2771: __timepunct_cache(const __timepunct_cache&); 2775: __timepunct_cache<_CharT>::~__timepunct_cache() 2786: __timepunct_cache::_S_timezones[14]; 2791: __timepunct_cache::_S_timezones[14]; 2796: const _CharT* __timepunct_cache<_CharT>::_S_timezones[14]; 2799: class __timepunct : public locale::facet 2805: typedef __timepunct_cache<_CharT> __cache_type; 2809: __c_locale _M_c_locale_timepunct; 2810: const char* _M_name_timepunct; 2817: __timepunct(size_t __refs = 0); 2820: __timepunct(__cache_type* __cache, size_t __refs = 0); 2833: __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0); 2836: // value of strftime/wcsftime. 2850: _M_time_formats(const _CharT** __time) const 2853: __time[0] = _M_data->_M_time_format; 2854: __time[1] = _M_data->_M_time_era_format; 2858: _M_date_time_formats(const _CharT** __dt) const 2861: __dt[0] = _M_data->_M_date_time_format; 2862: __dt[1] = _M_data->_M_date_time_era_format; 2936: ~__timepunct(); 2938: // For use at construction time only. 2940: _M_initialize_timepunct(__c_locale __cloc = NULL); 2944: locale::id __timepunct<_CharT>::id; 2949: __timepunct::_M_initialize_timepunct(__c_locale __cloc); 2953: __timepunct::_M_put(char*, size_t, const char*, const tm*) const; 2958: __timepunct::_M_initialize_timepunct(__c_locale __cloc); 2962: __timepunct::_M_put(wchar_t*, size_t, const wchar_t*, 2966: // Include host and configuration specific timepunct functions. 2967: #include  2970: * @brief Facet for parsing dates and times. 2973: * time from a string. It is used by the istream numeric 2976: * The time_get template uses protected virtual functions to provide the 2979: * implement the behavior they require from the time_get facet. 2982: class time_get : public locale::facet, public time_base 3004: time_get(size_t __refs = 0) 3010: * This function returns an enum from timebase::dateorder giving the 3011: * preferred ordering if the format "x" given to time_put::put() only 3014: * timebase::dateorder::noorder. 3018: * @return A member of timebase::dateorder. 3025: * @brief Parse input time string. 3027: * This function parses a time according to the format "x" and puts the 3029: * calling time_get::do_get_time(). 3031: * If there is a valid time string according to format "x", @a tm will 3033: * first character beyond the time string. If an error occurs before 3042: * @return Iterator to first char beyond time string. 3045: get_time(iter_type __beg, iter_type __end, ios_base& __io, 3047: { return this->do_get_time(__beg, __end, __io, __err, __tm); } 3054: * calling time_get::do_get_date(). 3079: * time_get::do_get_weekday(). 3107: * time_get::do_get_monthname(). 3136: * returned by calling time_get::do_get_year(). 3160: ~time_get() { } 3165: * This function returns an enum from timebase::dateorder giving the 3166: * preferred ordering if the format "x" given to time_put::put() only 3170: * @return A member of timebase::dateorder. 3176: * @brief Parse input time string. 3178: * This function parses a time according to the format "x" and puts the 3180: * derived classes to change the value returned. @see get_time() for 3188: * @return Iterator to first char beyond time string. 3191: do_get_time(iter_type __beg, iter_type __end, ios_base& __io, 3291: locale::id time_get<_CharT, _InIter>::id; 3293: /// @brief class time_get_byname [22.2.5.2]. 3295: class time_get_byname : public time_get<_CharT, _InIter> 3303: time_get_byname(const char*, size_t __refs = 0) 3304: : time_get<_CharT, _InIter>(__refs) { } 3308: ~time_get_byname() { } 3312: * @brief Facet for outputting dates and times. 3314: * This facet encapsulates the code to format and output dates and times 3315: * according to formats used by strftime(). 3317: * The time_put template uses protected virtual functions to provide the 3320: * implement the behavior they require from the time_put facet. 3323: class time_put : public locale::facet 3344: time_put(size_t __refs = 0) 3348: * @brief Format and output a time or date. 3352: * strftime(). 3357: * @param tm Struct tm with date and time info to format. 3367: * @brief Format and output a time or date. 3371: * are interpreted as by strftime(). It does so by returning 3372: * time_put::do_put(). 3377: * @param tm Struct tm with date and time info to format. 3390: ~time_put() 3394: * @brief Format and output a time or date. 3404: * @param tm Struct tm with date and time info to format. 3415: locale::id time_put<_CharT, _OutIter>::id; 3417: /// @brief class time_put_byname [22.2.5.4]. 3419: class time_put_byname : public time_put<_CharT, _OutIter> 3427: time_put_byname(const char*, size_t __refs = 0) 3428: : time_put<_CharT, _OutIter>(__refs) 3433: ~time_put_byname() { } 3881: // For use at construction time only. c++/4.0.0/bits/localefwd.h 145: // 22.2.5 date and time 146: class time_base; 148: class time_get; 150: class time_get_byname; 152: class time_put; 154: class time_put_byname; c++/4.0.0/bits/stl_bvector.h 407: * @brief A specialization of vector for booleans which offers fixed time c++/4.0.0/bits/stl_deque.h 378: //standard container and at the same time makes use of the EBO 512: * constant-time manipulation of elements at either end. 694: * this will call the elements' copy constructor N times (where N is 1015: * can be done in constant time. 1036: * done in constant time. 1177: * This exchanges the elements between two deques in constant time. c++/4.0.0/bits/stl_function.h 465: * Sometimes those typedefs are required, not just optional. c++/4.0.0/bits/stl_iterator_base_funcs.h 110: * and are constant time. For other %iterator classes they are linear time. 168: * and are constant time. For other %iterator classes they are linear time. c++/4.0.0/bits/stl_list.h 346: * @brief A standard container with linear time access to elements, 347: * and fixed time insertion/deletion at any point in the sequence. 359: * %list requires linear time, but adding and removing elements (or 360: * @e nodes) is done in constant time, regardless of where the 738: * done in constant time, and does not invalidate iterators and 750: * in constant time, and only invalidates iterators/references to 768: * in constant time, and does not invalidate iterators and 780: * in constant time, and only invalidates iterators/references to 798: * operation can be done in constant time, and does not 814: * constant time, and does not invalidate iterators and 832: * constant time, and does not invalidate iterators and 854: * constant time, and only invalidates iterators/references to 875: * constant time, and only invalidates iterators/references to 895: * time. Note that the global std::swap() function is 922: * The elements of @a x are inserted in constant time in front of 960: * before @a position in constant time. 1060: * Reverse the order of elements in the list in linear time. 1069: * Sorts the elements of this list in NlogN time. Equivalent 1078: * Sorts the elements of this list in NlogN time. Equivalent c++/4.0.0/bits/stl_map.h 70: * retrieved based on a key, in logarithmic time. 328: * Lookup requires logarithmic time. 356: * Insertion requires logarithmic time. 380: * Insertion requires logarithmic time (if the hint is not taken). 446: * This exchanges the elements between two maps in constant time. c++/4.0.0/bits/stl_multimap.h 87: * retrieved based on a key, in logarithmic time. 344: * Insertion requires logarithmic time. 368: * Insertion requires logarithmic time (if the hint is not taken). 435: * This exchanges the elements between two multimaps in constant time. c++/4.0.0/bits/stl_multiset.h 86: * in logarithmic time. 281: * This exchanges the elements between two multisets in constant time. 302: * Insertion requires logarithmic time. 326: * Insertion requires logarithmic time (if the hint is not taken). c++/4.0.0/bits/stl_queue.h 210: * to it. The time complexity of the operation depends on the 221: * The time complexity of the operation depends on the underlying 423: * The time complexity of the operation depends on the underlying 445: * by one. The time complexity of the operation depends on the c++/4.0.0/bits/stl_set.h 85: * retrieved in logarithmic time. 286: * This exchanges the elements between two sets in constant time. 309: * Insertion requires logarithmic time. 335: * Insertion requires logarithmic time (if the hint is not taken). c++/4.0.0/bits/stl_stack.h 186: * to it. The time complexity of the operation depends on the 197: * by one. The time complexity of the operation depends on the c++/4.0.0/bits/stl_tree.h 82: // time begin(), and to the rightmost node of the tree, to enable 83: // linear time performance when used with the generic set algorithms c++/4.0.0/bits/stl_vector.h 129: * @brief A standard container which offers fixed time access to 251: * constructor N times (where N is distance(first,last)) and do 598: * done in constant time if the %vector has preallocated space 727: * This exchanges the elements between two vectors in constant time. c++/4.0.0/cxxabi.h 33:/* This file declares the new abi entry points into the runtime. It is not 349: // UNKNOWN value. At other times we may use NOT_CONTAINED to mean 510: // Dynamic cast runtime. c++/4.0.0/debug/debug.h 355: * to see if we can check the range ahead of time. c++/4.0.0/ext/bitmap_allocator.h 628: // otherwise this will mess up big time. 996: * Amortized Constant time. 1093: * close to each other and this case is handled in O(1) time by c++/4.0.0/ext/codecvt_specializations.h 165: std::__throw_runtime_error(__N("encoding_state::_M_init " 172: std::__throw_runtime_error(__N("encoding_state::_M_init " c++/4.0.0/ext/debug_allocator.h 114: throw std::runtime_error("debug_allocator::deallocate" 120: throw std::runtime_error("debug_allocator::deallocate null pointer"); c++/4.0.0/ext/mt_allocator.h 59: // Compile time constants for the default _Tune values. 96: // Each time a deallocation occurs in a threaded application c++/4.0.0/ext/ropeimpl.h 781: // We should sometimes create substring node instead. 1691: // code bloat and compile time problem. (Fixed in 7.2.) c++/4.0.0/i686-apple-darwin10/bits/c++config.h 639:/* Define to 1 if you have the header file. */ 708:/* Define to 1 if you have the `wcsftime' function. */ c++/4.0.0/i686-apple-darwin10/bits/gthr-default.h 261:/* Yield our process time to another thread. */ c++/4.0.0/i686-apple-darwin10/bits/gthr-posix.h 261:/* Yield our process time to another thread. */ c++/4.0.0/i686-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.0.0/i686-apple-darwin10/bits/os_defines.h 162:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.0.0/i686-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 31:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 32:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 38: __timepunct<_CharT>::__timepunct(size_t __refs)  41: _M_name_timepunct = _S_get_c_name(); 42: _M_initialize_timepunct();  46: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  49: _M_name_timepunct = _S_get_c_name(); 50: _M_initialize_timepunct();  54: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  60: _M_name_timepunct = __tmp; 61: _M_initialize_timepunct(__cloc);  65: __timepunct<_CharT>::~__timepunct() 67: if (_M_name_timepunct != _S_get_c_name()) 68: delete [] _M_name_timepunct; 70: _S_destroy_c_locale(_M_c_locale_timepunct);  c++/4.0.0/powerpc-apple-darwin10/bits/c++config.h 639:/* Define to 1 if you have the header file. */ 708:/* Define to 1 if you have the `wcsftime' function. */ c++/4.0.0/powerpc-apple-darwin10/bits/gthr-default.h 261:/* Yield our process time to another thread. */ c++/4.0.0/powerpc-apple-darwin10/bits/gthr-posix.h 261:/* Yield our process time to another thread. */ c++/4.0.0/powerpc-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.0.0/powerpc-apple-darwin10/bits/os_defines.h 162:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.0.0/powerpc-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 31:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 32:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 38: __timepunct<_CharT>::__timepunct(size_t __refs)  41: _M_name_timepunct = _S_get_c_name(); 42: _M_initialize_timepunct();  46: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  49: _M_name_timepunct = _S_get_c_name(); 50: _M_initialize_timepunct();  54: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  60: _M_name_timepunct = __tmp; 61: _M_initialize_timepunct(__cloc);  65: __timepunct<_CharT>::~__timepunct() 67: if (_M_name_timepunct != _S_get_c_name()) 68: delete [] _M_name_timepunct; 70: _S_destroy_c_locale(_M_c_locale_timepunct);  c++/4.0.0/x86_64-apple-darwin10/bits/c++config.h 639:/* Define to 1 if you have the header file. */ 708:/* Define to 1 if you have the `wcsftime' function. */ c++/4.0.0/x86_64-apple-darwin10/bits/gthr-default.h 261:/* Yield our process time to another thread. */ c++/4.0.0/x86_64-apple-darwin10/bits/gthr-posix.h 261:/* Yield our process time to another thread. */ c++/4.0.0/x86_64-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.0.0/x86_64-apple-darwin10/bits/os_defines.h 162:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.0.0/x86_64-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 31:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 32:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 38: __timepunct<_CharT>::__timepunct(size_t __refs)  41: _M_name_timepunct = _S_get_c_name(); 42: _M_initialize_timepunct();  46: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  49: _M_name_timepunct = _S_get_c_name(); 50: _M_initialize_timepunct();  54: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  60: _M_name_timepunct = __tmp; 61: _M_initialize_timepunct(__cloc);  65: __timepunct<_CharT>::~__timepunct() 67: if (_M_name_timepunct != _S_get_c_name()) 68: delete [] _M_name_timepunct; 70: _S_destroy_c_locale(_M_c_locale_timepunct);  c++/4.2.1/bits/basic_string.h 1519: * time. 2370: * Exchanges the contents of @a lhs and @a rhs in constant time. c++/4.2.1/bits/boost_concept_check.h 58:// as possible at runtime, use as few resources as possible, and hopefully 68:// Unfortunately, this results in a link-time error, not a compile-time error. c++/4.2.1/bits/cpp_type_traits.h 46:// This file provides some compile-time information about various types. 53:// Firstly, these compile-time entities are used as template-arguments 54:// so function return values won't work: We need compile-time entities. 56:// Secondly, from the point of view of ease of use, type-based compile-time c++/4.2.1/bits/functexcept.h 78: __throw_runtime_error(const char*) __attribute__((__noreturn__)); c++/4.2.1/bits/ios_base.h 54: // expressions involving them are no longer compile-time constants. 707: * This function returns a unique integer every time it is called. It c++/4.2.1/bits/locale_classes.h 59: * as money, time, and number printing. 96: * The standard category values are none, ctype, numeric, collate, time, 108: static const category time = 1L << 3; 112: time | monetary | messages); 140: * @throw std::runtime_error if s is null or an undefined locale. 155: * @throw std::runtime_error if s is null or an undefined locale. 209: * @throw std::runtime_error if other has no facet of type Facet. 300: // collate, ctype, monetary, numeric, time, and messages. These 337: * money, time, and number printing. It provides common support for facets 500: static const locale::id* const _S_id_time[]; c++/4.2.1/bits/locale_facets.h 45:#include // For struct tm 1498: // For use at construction time only. 1868: // For use at construction time only. 2745: class time_base 2752: struct __timepunct_cache : public locale::facet 2754: // List of all known timezones, with GMT first. 2755: static const _CharT* _S_timezones[14]; 2759: const _CharT* _M_time_format; 2760: const _CharT* _M_time_era_format; 2761: const _CharT* _M_date_time_format; 2762: const _CharT* _M_date_time_era_format; 2815: __timepunct_cache(size_t __refs = 0) : facet(__refs), 2816: _M_date_format(NULL), _M_date_era_format(NULL), _M_time_format(NULL), 2817: _M_time_era_format(NULL), _M_date_time_format(NULL), 2818: _M_date_time_era_format(NULL), _M_am(NULL), _M_pm(NULL), 2832: ~__timepunct_cache(); 2838: __timepunct_cache& 2839: operator=(const __timepunct_cache&); 2842: __timepunct_cache(const __timepunct_cache&); 2846: __timepunct_cache<_CharT>::~__timepunct_cache() 2857: __timepunct_cache::_S_timezones[14]; 2862: __timepunct_cache::_S_timezones[14]; 2867: const _CharT* __timepunct_cache<_CharT>::_S_timezones[14]; 2870: class __timepunct : public locale::facet 2876: typedef __timepunct_cache<_CharT> __cache_type; 2880: __c_locale _M_c_locale_timepunct; 2881: const char* _M_name_timepunct; 2888: __timepunct(size_t __refs = 0); 2891: __timepunct(__cache_type* __cache, size_t __refs = 0); 2904: __timepunct(__c_locale __cloc, const char* __s, size_t __refs = 0); 2907: // value of strftime/wcsftime. 2921: _M_time_formats(const _CharT** __time) const 2924: __time[0] = _M_data->_M_time_format; 2925: __time[1] = _M_data->_M_time_era_format; 2929: _M_date_time_formats(const _CharT** __dt) const 2932: __dt[0] = _M_data->_M_date_time_format; 2933: __dt[1] = _M_data->_M_date_time_era_format; 3007: ~__timepunct(); 3009: // For use at construction time only. 3011: _M_initialize_timepunct(__c_locale __cloc = NULL); 3015: locale::id __timepunct<_CharT>::id; 3020: __timepunct::_M_initialize_timepunct(__c_locale __cloc); 3024: __timepunct::_M_put(char*, size_t, const char*, const tm*) const; 3029: __timepunct::_M_initialize_timepunct(__c_locale __cloc); 3033: __timepunct::_M_put(wchar_t*, size_t, const wchar_t*, 3039: // Include host and configuration specific timepunct functions. 3040: #include  3045: * @brief Facet for parsing dates and times. 3048: * time from a string. It is used by the istream numeric 3051: * The time_get template uses protected virtual functions to provide the 3054: * implement the behavior they require from the time_get facet. 3057: class time_get : public locale::facet, public time_base 3079: time_get(size_t __refs = 0) 3085: * This function returns an enum from timebase::dateorder giving the 3086: * preferred ordering if the format "x" given to time_put::put() only 3089: * timebase::dateorder::noorder. 3093: * @return A member of timebase::dateorder. 3100: * @brief Parse input time string. 3102: * This function parses a time according to the format "x" and puts the 3104: * calling time_get::do_get_time(). 3106: * If there is a valid time string according to format "x", @a tm will 3108: * first character beyond the time string. If an error occurs before 3117: * @return Iterator to first char beyond time string. 3120: get_time(iter_type __beg, iter_type __end, ios_base& __io, 3122: { return this->do_get_time(__beg, __end, __io, __err, __tm); } 3129: * calling time_get::do_get_date(). 3154: * time_get::do_get_weekday(). 3182: * time_get::do_get_monthname(). 3211: * returned by calling time_get::do_get_year(). 3235: ~time_get() { } 3240: * This function returns an enum from timebase::dateorder giving the 3241: * preferred ordering if the format "x" given to time_put::put() only 3245: * @return A member of timebase::dateorder. 3251: * @brief Parse input time string. 3253: * This function parses a time according to the format "x" and puts the 3255: * derived classes to change the value returned. @see get_time() for 3263: * @return Iterator to first char beyond time string. 3266: do_get_time(iter_type __beg, iter_type __end, ios_base& __io, 3366: locale::id time_get<_CharT, _InIter>::id; 3368: /// @brief class time_get_byname [22.2.5.2]. 3370: class time_get_byname : public time_get<_CharT, _InIter> 3378: time_get_byname(const char*, size_t __refs = 0) 3379: : time_get<_CharT, _InIter>(__refs) { } 3383: ~time_get_byname() { } 3387: * @brief Facet for outputting dates and times. 3389: * This facet encapsulates the code to format and output dates and times 3390: * according to formats used by strftime(). 3392: * The time_put template uses protected virtual functions to provide the 3395: * implement the behavior they require from the time_put facet. 3398: class time_put : public locale::facet 3419: time_put(size_t __refs = 0) 3423: * @brief Format and output a time or date. 3427: * strftime(). 3432: * @param tm Struct tm with date and time info to format. 3442: * @brief Format and output a time or date. 3446: * are interpreted as by strftime(). It does so by returning 3447: * time_put::do_put(). 3452: * @param tm Struct tm with date and time info to format. 3465: ~time_put() 3469: * @brief Format and output a time or date. 3479: * @param tm Struct tm with date and time info to format. 3490: locale::id time_put<_CharT, _OutIter>::id; 3492: /// @brief class time_put_byname [22.2.5.4]. 3494: class time_put_byname : public time_put<_CharT, _OutIter> 3502: time_put_byname(const char*, size_t __refs = 0) 3503: : time_put<_CharT, _OutIter>(__refs) 3508: ~time_put_byname() { } 3956: // For use at construction time only. c++/4.2.1/bits/localefwd.h 147: // 22.2.5 date and time 148: class time_base; 150: class time_get; 152: class time_get_byname; 154: class time_put; 156: class time_put_byname; c++/4.2.1/bits/stl_bvector.h 438: * @brief A specialization of vector for booleans which offers fixed time c++/4.2.1/bits/stl_deque.h 395: //standard container and at the same time makes use of the EBO 546: * constant-time manipulation of elements at either end. 721: * this will call the elements' copy constructor N times (where N is 1029: * can be done in constant time. 1050: * done in constant time. 1191: * This exchanges the elements between two deques in constant time. c++/4.2.1/bits/stl_function.h 465: * Sometimes those typedefs are required, not just optional. c++/4.2.1/bits/stl_iterator_base_funcs.h 111: * and are constant time. For other %iterator classes they are linear time. 169: * and are constant time. For other %iterator classes they are linear time. c++/4.2.1/bits/stl_list.h 362: * @brief A standard container with linear time access to elements, 363: * and fixed time insertion/deletion at any point in the sequence. 375: * %list requires linear time, but adding and removing elements (or 376: * @e nodes) is done in constant time, regardless of where the 729: * done in constant time, and does not invalidate iterators and 741: * in constant time, and only invalidates iterators/references to 759: * in constant time, and does not invalidate iterators and 771: * in constant time, and only invalidates iterators/references to 789: * operation can be done in constant time, and does not 845: * constant time, and only invalidates iterators/references to 865: * This operation is linear time in the size of the range and only 885: * time. Note that the global std::swap() function is 919: * The elements of @a x are inserted in constant time in front of 967: * before @a position in constant time. 1072: * Reverse the order of elements in the list in linear time. 1081: * Sorts the elements of this list in NlogN time. Equivalent 1090: * Sorts the elements of this list in NlogN time. Equivalent 1180: __throw_runtime_error(__N("list::_M_check_equal_allocators")); c++/4.2.1/bits/stl_map.h 72: * retrieved based on a key, in logarithmic time. 339: * Lookup requires logarithmic time. 396: * Insertion requires logarithmic time. 423: * Insertion requires logarithmic time (if the hint is not taken). 491: * time. (It is only swapping a pointer, an integer, and an c++/4.2.1/bits/stl_multimap.h 70: * retrieved based on a key, in logarithmic time. 336: * Insertion requires logarithmic time. 360: * Insertion requires logarithmic time (if the hint is not taken). 427: * This exchanges the elements between two multimaps in constant time. c++/4.2.1/bits/stl_multiset.h 70: * in logarithmic time. 270: * This exchanges the elements between two multisets in constant time. 291: * Insertion requires logarithmic time. 315: * Insertion requires logarithmic time (if the hint is not taken). c++/4.2.1/bits/stl_queue.h 199: * to it. The time complexity of the operation depends on the 210: * The time complexity of the operation depends on the underlying 409: * The time complexity of the operation depends on the underlying 423: * by one. The time complexity of the operation depends on the c++/4.2.1/bits/stl_set.h 70: * retrieved in logarithmic time. 278: * This exchanges the elements between two sets in constant time. 301: * Insertion requires logarithmic time. 328: * Insertion requires logarithmic time (if the hint is not taken). c++/4.2.1/bits/stl_stack.h 174: * to it. The time complexity of the operation depends on the 185: * by one. The time complexity of the operation depends on the c++/4.2.1/bits/stl_tree.h 85: // time begin(), and to the rightmost node of the tree, to enable 86: // linear time performance when used with the generic set algorithms c++/4.2.1/bits/stl_vector.h 143: * @brief A standard container which offers fixed time access to 249: * constructor N times (where N is distance(first,last)) and do 596: * done in constant time if the %vector has preallocated space 725: * This exchanges the elements between two vectors in constant time. c++/4.2.1/cxxabi.h 33:/* This file declares the new abi entry points into the runtime. It is not 349: // UNKNOWN value. At other times we may use NOT_CONTAINED to mean 510: // Dynamic cast runtime. c++/4.2.1/debug/functions.h 120: * to see if we can check the range ahead of time. c++/4.2.1/ext/bitmap_allocator.h 472: // otherwise this will mess up big time. 843: * Amortized Constant time. 940: * close to each other and this case is handled in O(1) time by c++/4.2.1/ext/codecvt_specializations.h 175: std::__throw_runtime_error(__N("encoding_state::_M_init " 182: std::__throw_runtime_error(__N("encoding_state::_M_init " c++/4.2.1/ext/concurrence.h 53: // Compile time constant that indicates prefered locking policy in 58: // set somewhat haphazardly at configure time. c++/4.2.1/ext/debug_allocator.h 116: throw std::runtime_error("debug_allocator::deallocate" 122: throw std::runtime_error("debug_allocator::deallocate null pointer"); c++/4.2.1/ext/mt_allocator.h 60: // Compile time constants for the default _Tune values. 101: // Each time a deallocation occurs in a threaded application c++/4.2.1/ext/numeric_traits.h 46: // Compile time constants for builtin types. c++/4.2.1/ext/rc_string_base.h 392: // meet amortized linear time requirements of the library: see c++/4.2.1/ext/ropeimpl.h 781: // We should sometimes create substring node instead. 1691: // code bloat and compile time problem. (Fixed in 7.2.) c++/4.2.1/ext/sso_string_base.h 312: // meet amortized linear time requirements of the library: see c++/4.2.1/ext/throw_allocator.h 73: static_cast(std::time(0))); c++/4.2.1/ext/vstring.h 1243: * time. 2101: * Exchanges the contents of @a lhs and @a rhs in constant time. c++/4.2.1/i686-apple-darwin10/bits/c++config.h 560:/* Define to 1 if you have the header file. */ c++/4.2.1/i686-apple-darwin10/bits/gthr-default.h 359:/* Yield our process time to another thread. */ c++/4.2.1/i686-apple-darwin10/bits/gthr-posix.h 359:/* Yield our process time to another thread. */ c++/4.2.1/i686-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.2.1/i686-apple-darwin10/bits/os_defines.h 53:/* Inline copy of dtrace_cxa_runtime.h. */ 67:#define CXA_RUNTIME_STABILITY "___dtrace_stability$cxa_runtime$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0" 69:#define CXA_RUNTIME_TYPEDEFS "___dtrace_typedefs$cxa_runtime$v2" 74: __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(); \ 78: __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1() 82: __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(arg0); \ 86: __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1() 89:extern void __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(void); 90:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1(void); 91:extern void __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(void *); 92:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1(void); 216:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.2.1/i686-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 30:/** @file time_members.h 36:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 37:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 45: __timepunct<_CharT>::__timepunct(size_t __refs)  48: _M_name_timepunct = _S_get_c_name(); 49: _M_initialize_timepunct();  53: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  56: _M_name_timepunct = _S_get_c_name(); 57: _M_initialize_timepunct();  61: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  68: _M_name_timepunct = __tmp; 71: { _M_initialize_timepunct(__cloc); } 74: delete [] _M_name_timepunct; 80: __timepunct<_CharT>::~__timepunct() 82: if (_M_name_timepunct != _S_get_c_name()) 83: delete [] _M_name_timepunct; 85: _S_destroy_c_locale(_M_c_locale_timepunct);  c++/4.2.1/powerpc-apple-darwin10/bits/c++config.h 560:/* Define to 1 if you have the header file. */ c++/4.2.1/powerpc-apple-darwin10/bits/gthr-default.h 359:/* Yield our process time to another thread. */ c++/4.2.1/powerpc-apple-darwin10/bits/gthr-posix.h 359:/* Yield our process time to another thread. */ c++/4.2.1/powerpc-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.2.1/powerpc-apple-darwin10/bits/os_defines.h 53:/* Inline copy of dtrace_cxa_runtime.h. */ 67:#define CXA_RUNTIME_STABILITY "___dtrace_stability$cxa_runtime$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0" 69:#define CXA_RUNTIME_TYPEDEFS "___dtrace_typedefs$cxa_runtime$v2" 74: __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(); \ 78: __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1() 82: __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(arg0); \ 86: __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1() 89:extern void __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(void); 90:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1(void); 91:extern void __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(void *); 92:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1(void); 216:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.2.1/powerpc-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 30:/** @file time_members.h 36:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 37:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 45: __timepunct<_CharT>::__timepunct(size_t __refs)  48: _M_name_timepunct = _S_get_c_name(); 49: _M_initialize_timepunct();  53: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  56: _M_name_timepunct = _S_get_c_name(); 57: _M_initialize_timepunct();  61: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  68: _M_name_timepunct = __tmp; 71: { _M_initialize_timepunct(__cloc); } 74: delete [] _M_name_timepunct; 80: __timepunct<_CharT>::~__timepunct() 82: if (_M_name_timepunct != _S_get_c_name()) 83: delete [] _M_name_timepunct; 85: _S_destroy_c_locale(_M_c_locale_timepunct);  c++/4.2.1/x86_64-apple-darwin10/bits/c++config.h 560:/* Define to 1 if you have the header file. */ c++/4.2.1/x86_64-apple-darwin10/bits/gthr-default.h 359:/* Yield our process time to another thread. */ c++/4.2.1/x86_64-apple-darwin10/bits/gthr-posix.h 359:/* Yield our process time to another thread. */ c++/4.2.1/x86_64-apple-darwin10/bits/gthr-single.h 93:/* Yield our process time to another thread. */ c++/4.2.1/x86_64-apple-darwin10/bits/os_defines.h 53:/* Inline copy of dtrace_cxa_runtime.h. */ 67:#define CXA_RUNTIME_STABILITY "___dtrace_stability$cxa_runtime$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0" 69:#define CXA_RUNTIME_TYPEDEFS "___dtrace_typedefs$cxa_runtime$v2" 74: __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(); \ 78: __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1() 82: __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(arg0); \ 86: __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1() 89:extern void __dtrace_probe$cxa_runtime$cxa_exception_rethrow$v1(void); 90:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_rethrow$v1(void); 91:extern void __dtrace_probe$cxa_runtime$cxa_exception_throw$v1$766f6964202a(void *); 92:extern int __dtrace_isenabled$cxa_runtime$cxa_exception_throw$v1(void); 216:#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/ c++/4.2.1/x86_64-apple-darwin10/bits/time_members.h 1:// std::time_get, std::time_put implementation, generic version -*- C++ -*- 30:/** @file time_members.h 36:// ISO C++ 14882: 22.2.5.1.2 - time_get functions 37:// ISO C++ 14882: 22.2.5.3.2 - time_put functions 45: __timepunct<_CharT>::__timepunct(size_t __refs)  48: _M_name_timepunct = _S_get_c_name(); 49: _M_initialize_timepunct();  53: __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)  56: _M_name_timepunct = _S_get_c_name(); 57: _M_initialize_timepunct();  61: __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,  68: _M_name_timepunct = __tmp; 71: { _M_initialize_timepunct(__cloc); } 74: delete [] _M_name_timepunct; 80: __timepunct<_CharT>::~__timepunct() 82: if (_M_name_timepunct != _S_get_c_name()) 83: delete [] _M_name_timepunct; 85: _S_destroy_c_locale(_M_c_locale_timepunct);  cache.h 8: The cache determines its size and may remove keys at any time. 10: unreferenced. Unreferenced values may be removed at any time. 299: * and may release it at any time by calling the key release callback. checkint.h 51: * and are subject to change at any time without warning. cups/cgi.h 21:# include <time.h> 85: time_t expires, int secure); cups/cups.h 39: * a warning at compile-time. 68:# define CUPS_DATE_ANY (time_t)-1 166: time_t completed_time; /* Time the job was completed */ 167: time_t creation_time; /* Time the job was created */ 168: time_t processing_time; /* Time the job was processed */ 258: double timeout) _CUPS_API_1_2; 260: double timeout) _CUPS_API_1_2; 296:extern ipp_status_t cupsGetDevices(http_t *http, int timeout, 307: time_t *modtime, char *buffer, cups/driver.h 29:# include <time.h> cups/file.h 7: * write similar functions without this limit. At the same time, using cups/help-index.h 43: time_t mtime; /* Last modification time */ cups/http.h 28:# include <time.h> 43:# include  234: HTTP_REQUEST_TIMEOUT, /* Request timed out */ 250: HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */ 338:extern const char *httpGetDateString(time_t t); 339:extern time_t httpGetDateTime(const char *s); 418:extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2; cups/ipp.h 88: IPP_TAG_DATE, /* Date/time value */ 111: IPP_RES_PER_CM /* Pixels per centimeter */ 275: IPP_TIMEOUT, /* client-error-timeout */ 356: ipp_uchar_t date[11]; /* Date/time value */ 448:extern time_t ippDateToTime(const ipp_uchar_t *date); 458:extern const ipp_uchar_t *ippTimeToDate(time_t t); cups/language.h 90: int used; /* Number of times this entry has been used. */ cups/sidechannel.h 108: double timeout) _CUPS_API_1_3; 112: double timeout) _CUPS_API_1_3; 116: double timeout) _CUPS_API_1_3; 120: int *datalen, double timeout) 122:extern cups_sc_status_t cupsSideChannelSNMPWalk(const char *oid, double timeout, cups/versioning.h 63: * a warning at compile-time. curl/curl.h 50:/* The include stuff here below is mainly for time_t! */ 53:# include <time.h> 56:# include <time.h> 81:#include  178: time for those who feel adventurous. */ 322: /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error 326: CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ 666: * during "low speed time" seconds, the operations is aborted. 674: /* Set the "low speed time" */ 718: /* What kind of HTTP time condition to use, see defines */ 843: are OK within this time, then fine... This only aborts the connect 897: /* DNS cache timeout */ 920: timeouts. This option is useful for multi-threaded applications. 976: /* FTP option that changes the timeout, in seconds, associated with 977: getting a response. This is different from transfer timeout time and 979: in a timely manner. */ 1241:/* This is set if CURL_NO_OLDIES is defined at compile-time */ 1578: * Returns the time, in seconds since 1 Jan 1970 of the time string given in 1579: * the first argument. The time argument in the second parameter is unused 1582:CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); 1727: * Structures for querying information about the curl library at runtime. curl/curlrules.h 56: * Some of the following compile time checks are based on the fact 58: * In this way if the compile time verification fails, the compilation 129: * is the same as the one reported by sizeof() at compile time. 139: * by sizeof() at compile time. 147: * Verify at compile time that the size of curl_off_t as reported curl/curlver.h 27: a script at release-time. This was made its own header file in 7.11.2 */ 60: * This is the date and time when the full source package was created. The 61: * timestamp is not stored in CVS, as the timestamp is properly set in the curl/multi.h 177: * time, until a special "end of msgs" struct is returned as a signal 239: * Name: curl_multi_timer_callback 244: * (to allow libcurl's timed events to take place). 248:typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ 249: long timeout_ms, /* see above */ 272: * Name: curl_multi_timeout() 276: * called (to allow libcurl's timed events to take place). 280:CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, 306: /* This is the timer callback function pointer */ 309: /* This is the argument passed to the timer callback */ curses.h 380: bool _notimeout; /* no time out on function-key entry? */ 427: /* Fix _nc_timed_wait() on BEOS... */ 447: long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ 667:extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */ 722:extern NCURSES_EXPORT(void) timeout (int); /* generated */ 789:extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ 867:extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */ 1053:#define timeout(delay) wtimeout(stdscr,delay) 1158:#define is_notimeout(win) ((win)->_notimeout) 1173: * It gives the ESC expire time in milliseconds. 1714:#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ dispatch/dispatch.h 25:#include  dispatch/group.h 112: * returns if the blocks have not completed within the specified timeout. 117: * the specified timeout has elapsed. When a timeout occurs, the group is 134: * @param timeout 135: * When to timeout (see dispatch_time). As a convenience, there are the 140: * within the specified timeout) or non-zero on error (i.e. timed out). 145:dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout); 161: * The group will be empty at the time the notification block is submitted to dispatch/object.h 131: * context of the dispatch object at the time the finalizer call is made. dispatch/queue.h 23: * one block submitted to the FIFO dispatch queue will be invoked at a time. 35: * queue will only invoke one block at a time, but independe C-c C-cnt queues may each 490: * Schedule a block for execution on a given queue at a specified time. 498: * A temporal milestone returned by dispatch_time() or dispatch_walltime(). 501: * A queue to which the given block will be submitted at the specified time. 512:dispatch_after(dispatch_time_t when, 521: * Schedule a function for execution on a given queue at a specified time. 527: * A temporal milestone returned by dispatch_time() or dispatch_walltime(). 530: * A queue to which the given function will be submitted at the specified time. 545:dispatch_after_f(dispatch_time_t when, dispatch/semaphore.h 60: * @param timeout 61: * When to timeout (see dispatch_time). As a convenience, there are the 65: * Returns zero on success, or non-zero if the timeout occurred. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 25 11:25:43 2010 Received: (at 7089-done) by debbugs.gnu.org; 25 Nov 2010 16:25:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLedj-0003Vf-Ac for submit@debbugs.gnu.org; Thu, 25 Nov 2010 11:25:43 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLedh-0003VR-1C for 7089-done@debbugs.gnu.org; Thu, 25 Nov 2010 11:25:41 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oAPGV1Up016156; Thu, 25 Nov 2010 11:31:02 -0500 Received: by pastel.home (Postfix, from userid 20848) id 387BEA8490; Thu, 25 Nov 2010 11:31:01 -0500 (EST) From: Stefan Monnier To: Leo Subject: Re: bug#7089: 23.2; slow ansi-color-apply Message-ID: References: Date: Thu, 25 Nov 2010 11:31:01 -0500 In-Reply-To: (Leo's message of "Thu, 25 Nov 2010 14:30:54 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3689=0 X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 7089-done Cc: 7089-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >>> Do you know for sure string-match is slower (more CPU intensive) than >>> re-search-forward? >> They should be largely equivalent. The difference between the two codes >> might be due to replace-match and substring. I.e. the original >> ansi-color-apply should be at least as efficient as your code (if not >> more) in the case where there are no SGR escape sequences. > I was setting out to profile the two versions of the function and > unfortunately I was not able to see the CPU shootup mentioned in the > first message. My result shows my version of ansi-color-apply is almost > twice as slow as the original one. (The code and data used for profiling > are attached.) OK, thanks. As mentioned, it might depend on the density of SGR escape sequences (and on the size of the text chunks processed, which can depend on the machine load). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 26 09:30:05 2010 Received: (at 7089-done) by debbugs.gnu.org; 26 Nov 2010 14:30:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLzJN-0007Kv-Da for submit@debbugs.gnu.org; Fri, 26 Nov 2010 09:30:05 -0500 Received: from ppsw-50.csi.cam.ac.uk ([131.111.8.150]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PLzJL-0007KA-3i for 7089-done@debbugs.gnu.org; Fri, 26 Nov 2010 09:30:03 -0500 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc1-cmbg13-0-0-cust596.5-4.cable.virginmedia.com ([86.9.122.85]:59472 helo=Victoria.local) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1PLzOa-0001c8-pl (Exim 4.72) (return-path ); Fri, 26 Nov 2010 14:35:28 +0000 From: Leo To: Stefan Monnier Subject: Re: bug#7089: 23.2; slow ansi-color-apply References: Date: Fri, 26 Nov 2010 14:35:26 +0000 In-Reply-To: (Stefan Monnier's message of "Thu, 25 Nov 2010 11:31:01 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.5) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: 7089-done Cc: 7089-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) On 2010-11-25 16:31 +0000, Stefan Monnier wrote: >> I was setting out to profile the two versions of the function and >> unfortunately I was not able to see the CPU shootup mentioned in the >> first message. My result shows my version of ansi-color-apply is almost >> twice as slow as the original one. (The code and data used for profiling >> are attached.) > > OK, thanks. As mentioned, it might depend on the density of SGR escape > sequences (and on the size of the text chunks processed, which can > depend on the machine load). For the record, there's a bug in my version due to the use of copy-marker, which will create many markers in the temp buffer. Should use set-marker instead. But even after fixing this, mine is still slower. So the conclusion holds. While doing this I have found a bug in the original ansi-color-apply. I'll put it in a separate report. Leo From unknown Fri Sep 05 20:36:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 25 Dec 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator