[PATCH] benchmarks: do not activate %debug by default.

View: New views
3 Messages — Rating Filter:   Alert me  

[PATCH] benchmarks: do not activate %debug by default.

by Joel E. Denny-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Akim.

I'm finding bench.pl to be quite useful.  :)

I'd like to push this patch to master, branch-2.5, and maybe even
branch-2.4.2 in case it might be around a little longer.  Any objections?

From c93d4b165d865028f3f06e13bcc36d8bd98f19df Mon Sep 17 00:00:00 2001
From: Joel E. Denny <jdenny@...>
Date: Sun, 13 Sep 2009 16:11:12 -0400
Subject: [PATCH] benchmarks: do not activate %debug by default.

* etc/bench.pl.in (generate_grammar_triangular): Here.  It can
affect the timings even if yydebug=0.
---
 ChangeLog       |    6 ++++++
 etc/bench.pl.in |    3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f99cc59..50ac4dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-09-13  Joel E. Denny  <jdenny@...>
 
+ benchmarks: do not activate %debug by default.
+ * etc/bench.pl.in (generate_grammar_triangular): Here.  It can
+ affect the timings even if yydebug=0.
+
+2009-09-13  Joel E. Denny  <jdenny@...>
+
  tests: clean up push.at test group titles.
  * tests/push.at: Remove "Push Parsing: " from test group titles
  because these are already under the banner "Push Parsing Tests".
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 2290fd2..623583c 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -246,7 +246,6 @@ sub generate_grammar_triangular ($$@)
     or die;
   print $out <<EOF;
 %error-verbose
-%debug
 %{
 #include <stdio.h>
 #include <stdlib.h>
@@ -318,7 +317,9 @@ yyerror (const char *msg)
 int
 main (void)
 {
+#if YYDEBUG
   yydebug = !!getenv ("YYDEBUG");
+#endif
   return yyparse ();
 }
 EOF
--
1.5.4.3




Re: [PATCH] benchmarks: do not activate %debug by default.

by Akim Demaille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 13 sept. 2009 à 22:31, Joel E. Denny a écrit :

> Hi Akim.
>
> I'm finding bench.pl to be quite useful.  :)

Good :)

> I'd like to push this patch to master, branch-2.5, and maybe even
> branch-2.4.2 in case it might be around a little longer.  Any  
> objections?
>
> * etc/bench.pl.in (generate_grammar_triangular): Here.  It can
> affect the timings even if yydebug=0.

Perfect with me.


Re: [PATCH] benchmarks: do not activate %debug by default.

by Joel E. Denny-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 16 Sep 2009, Akim Demaille wrote:

> > I'd like to push this patch to master, branch-2.5, and maybe even
> > branch-2.4.2 in case it might be around a little longer.  Any objections?
> >
> > * etc/bench.pl.in (generate_grammar_triangular): Here.  It can
> > affect the timings even if yydebug=0.
>
> Perfect with me.

Thanks.

I pushed the following instead.  It also makes the calc grammar work the
same way.  I realize now that only master takes %debug on the
command-line, so I only pushed there.

From 37318e2fe9a8d468088ddb782539f88b3a4c2bb8 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <jdenny@...>
Date: Sun, 4 Oct 2009 14:33:28 -0400
Subject: [PATCH] benchmarks: use %debug consistently among grammars.

* etc/bench.pl.in (generate_grammar_triangular): Do not activate
%debug by default.  It can affect the timings even if yydebug=0.
(generate_grammar_calc): For consistency with other grammars,
use YYDEBUG environment variable to set yydebug.
---
 ChangeLog       |    8 ++++++++
 etc/bench.pl.in |    7 ++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ea72b2..a813d69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-04  Joel E. Denny  <jdenny@...>
+
+ benchmarks: use %debug consistently among grammars.
+ * etc/bench.pl.in (generate_grammar_triangular): Do not activate
+ %debug by default.  It can affect the timings even if yydebug=0.
+ (generate_grammar_calc): For consistency with other grammars,
+ use YYDEBUG environment variable to set yydebug.
+
 2009-10-03  Joel E. Denny  <jdenny@...>
 
  Remove dead code.
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 2290fd2..cfa055d 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -246,7 +246,6 @@ sub generate_grammar_triangular ($$@)
     or die;
   print $out <<EOF;
 %error-verbose
-%debug
 %{
 #include <stdio.h>
 #include <stdlib.h>
@@ -318,7 +317,9 @@ yyerror (const char *msg)
 int
 main (void)
 {
+#if YYDEBUG
   yydebug = !!getenv ("YYDEBUG");
+#endif
   return yyparse ();
 }
 EOF
@@ -543,6 +544,10 @@ main (int argc, const char **argv)
   int count = 0;
   int status;
 
+#if YYDEBUG
+  yydebug = !!getenv ("YYDEBUG");
+#endif
+
   input = fopen ("calc.input", "r");
   if (!input)
     {
--
1.5.4.3