aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-02-05 10:02:09 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-02-05 10:02:09 +0200
commitd18edce5957afdc3a286cf4ce1ca141a3cdc7be5 (patch)
tree3c7fd5d5e5e3aa2332283e480c6ccccfbb029861 /doc/gawk.texi
parent5f8279884b6743cd75388023335ff60093af6d85 (diff)
downloadegawk-d18edce5957afdc3a286cf4ce1ca141a3cdc7be5.tar.gz
egawk-d18edce5957afdc3a286cf4ce1ca141a3cdc7be5.tar.bz2
egawk-d18edce5957afdc3a286cf4ce1ca141a3cdc7be5.zip
Turn optimization on by default. New -s option to disable it.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi25
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index fab29487..fe5c5698 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -4081,6 +4081,7 @@ when parsing numeric input data (@pxref{Locales}).
@cindex @option{-o} option
@cindex @option{--pretty-print} option
Enable pretty-printing of @command{awk} programs.
+Implies @option{--no-optimize}.
By default, the output program is created in a file named @file{awkprof.out}
(@pxref{Profiling}).
The optional @var{file} argument allows you to specify a different
@@ -4097,8 +4098,14 @@ This is no longer the case.
@itemx @option{--optimize}
@cindex @option{--optimize} option
@cindex @option{-O} option
-Enable some optimizations on the internal representation of the program.
-At the moment, this includes just simple constant folding.
+Enable @command{gawk}'s default optimizations on the internal
+representation of the program. At the moment, this includes simple
+constant folding and tail recursion elimination in function calls.
+
+These optimizations are enabled by default.
+This option remains primarily for backwards compatibilty. However, it may
+be used to cancel the effect of an earlier @option{-s} option
+(see later in this list).
@item @option{-p}[@var{file}]
@itemx @option{--profile}[@code{=}@var{file}]
@@ -4107,6 +4114,7 @@ At the moment, this includes just simple constant folding.
@cindex @command{awk} profiling, enabling
Enable profiling of @command{awk} programs
(@pxref{Profiling}).
+Implies @option{--no-optimize}.
By default, profiles are created in a file named @file{awkprof.out}.
The optional @var{file} argument allows you to specify a different
@value{FN} for the profile file.
@@ -4173,6 +4181,13 @@ This is now @command{gawk}'s default behavior.
Nevertheless, this option remains (both for backward compatibility
and for use in combination with @option{--traditional}).
+@item @option{-s}
+@itemx @option{--no-optimize}
+@cindex @option{--no-optimize} option
+@cindex @option{-s} option
+Disable @command{gawk}'s default optimizations on the internal
+representation of the program.
+
@item @option{-S}
@itemx @option{--sandbox}
@cindex @option{-S} option
@@ -28286,6 +28301,10 @@ that the profiling output does. This makes it easy to pretty-print your
code once development is completed, and then use the result as the final
version of your program.
+Because the internal representation of your program is formatted to
+recreate an @command{awk} program, profiling and pretty-printing
+automatically disable @command{gawk}'s default optimizations.
+
@node Advanced Features Summary
@section Summary
@@ -36403,6 +36422,7 @@ The
@option{-p},
@option{-P},
@option{-r},
+@option{-s},
@option{-S},
@option{-t},
and
@@ -36427,6 +36447,7 @@ and the
@option{--load},
@option{--non-decimal-data},
@option{--optimize},
+@option{--no-optimize},
@option{--posix},
@option{--pretty-print},
@option{--profile},