You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2014/06/24 20:06:28 UTC
git commit: [flex-falcon] [refs/heads/develop] - Enabled some extra
optimisations in the GCC.
Repository: flex-falcon
Updated Branches:
refs/heads/develop fe8c46693 -> fc8df1ba4
Enabled some extra optimisations in the GCC.
Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/fc8df1ba
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fc8df1ba
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fc8df1ba
Branch: refs/heads/develop
Commit: fc8df1ba494e73c9501331aa1826d580ffb71041
Parents: fe8c466
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Tue Jun 24 20:05:12 2014 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Tue Jun 24 20:05:21 2014 +0200
----------------------------------------------------------------------
.../utils/JSClosureCompilerWrapper.java | 73 ++++++++++++++++++++
1 file changed, 73 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fc8df1ba/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
index e09ad62..a940aa6 100644
--- a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
+++ b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
@@ -145,12 +145,85 @@ public class JSClosureCompilerWrapper
options_.setLanguageIn(LanguageMode.ECMASCRIPT5_STRICT);
+ options_.setPreferSingleQuotes(true);
+
+ options_.setFoldConstants(true);
+ options_.setDeadAssignmentElimination(true);
+ options_.setInlineConstantVars(true);
+ options_.setInlineFunctions(true);
+ options_.setInlineLocalFunctions(true);
+ options_.setCrossModuleCodeMotion(true);
+ options_.setCoalesceVariableNames(true);
+ options_.setCrossModuleMethodMotion(true);
+ options_.setInlineGetters(true);
+ options_.setInlineVariables(true);
+ options_.setSmartNameRemoval(true);
+ options_.setRemoveDeadCode(true);
+ options_.setCheckMissingReturn(CheckLevel.WARNING);
+ options_.setExtractPrototypeMemberDeclarations(true);
+ options_.setRemoveUnusedPrototypeProperties(true);
+ options_.setRemoveUnusedPrototypePropertiesInExterns(true);
+ options_.setRemoveUnusedClassProperties(true);
+ options_.setRemoveUnusedVars(true);
+ options_.setRemoveUnusedLocalVars(true);
+ options_.setAliasExternals(true);
+ options_.setCollapseVariableDeclarations(true);
+ options_.setCollapseAnonymousFunctions(true);
+ options_.setAliasAllStrings(true);
+ options_.setConvertToDottedProperties(true);
+ options_.setRewriteFunctionExpressions(true);
+ options_.setOptimizeParameters(true);
+ options_.setOptimizeReturns(true);
+ options_.setOptimizeCalls(true);
+ options_.setOptimizeArgumentsArray(true);
+
+ // warnings already activated in previous incarnation
options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.CONST, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.CONSTANT_PROPERTY, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.VISIBILITY, CheckLevel.WARNING);
options_.setWarningLevel(DiagnosticGroups.DEPRECATED, CheckLevel.OFF);
+
+ /*
+ // the 'full' set of warnings
+ options_.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_EVENTFUL_OBJECT_DISPOSAL, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_PROVIDES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_REGEXP, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_STRUCT_DICT_INHERITANCE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_USELESS_CODE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.DUPLICATE_MESSAGE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.DUPLICATE_VARS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.ES3, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.ES5_STRICT, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.GLOBAL_THIS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.INTERNET_EXPLORER_CHECKS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.INVALID_CASTS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.MISPLACED_TYPE_ANNOTATION, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.MISSING_RETURN, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES, CheckLevel.OFF);
+ options_.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.REPORT_UNKNOWN_TYPES, CheckLevel.OFF);
+ options_.setWarningLevel(DiagnosticGroups.SUSPICIOUS_CODE, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.TWEAKS, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.TYPE_INVALIDATION, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.WARNING);
+ options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS, CheckLevel.OFF);
+ options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.OFF);
+ options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP, CheckLevel.WARNING);
+ //*/
}
options_.sourceMapFormat = SourceMap.Format.V3;
Re: git commit: [flex-falcon] [refs/heads/develop] - Enabled some
extra optimisations in the GCC.
Posted by Erik de Bruin <er...@ixsoftware.nl>.
Told you we could do fun things with the new GCC setup: this extra set of
optimisations takes down the size of the 'DataBindingTest' example output
(js-release) from 81 kb to 69 kb, a 15% reduction in download size :-)
EdB
On Tue, Jun 24, 2014 at 8:06 PM, <er...@apache.org> wrote:
> Repository: flex-falcon
> Updated Branches:
> refs/heads/develop fe8c46693 -> fc8df1ba4
>
>
> Enabled some extra optimisations in the GCC.
>
> Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/fc8df1ba
> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fc8df1ba
> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fc8df1ba
>
> Branch: refs/heads/develop
> Commit: fc8df1ba494e73c9501331aa1826d580ffb71041
> Parents: fe8c466
> Author: Erik de Bruin <er...@ixsoftware.nl>
> Authored: Tue Jun 24 20:05:12 2014 +0200
> Committer: Erik de Bruin <er...@ixsoftware.nl>
> Committed: Tue Jun 24 20:05:21 2014 +0200
>
> ----------------------------------------------------------------------
> .../utils/JSClosureCompilerWrapper.java | 73 ++++++++++++++++++++
> 1 file changed, 73 insertions(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fc8df1ba/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
> ----------------------------------------------------------------------
> diff --git
> a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
> b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
> index e09ad62..a940aa6 100644
> ---
> a/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
> +++
> b/compiler.jx/src/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
> @@ -145,12 +145,85 @@ public class JSClosureCompilerWrapper
>
> options_.setLanguageIn(LanguageMode.ECMASCRIPT5_STRICT);
>
> + options_.setPreferSingleQuotes(true);
> +
> + options_.setFoldConstants(true);
> + options_.setDeadAssignmentElimination(true);
> + options_.setInlineConstantVars(true);
> + options_.setInlineFunctions(true);
> + options_.setInlineLocalFunctions(true);
> + options_.setCrossModuleCodeMotion(true);
> + options_.setCoalesceVariableNames(true);
> + options_.setCrossModuleMethodMotion(true);
> + options_.setInlineGetters(true);
> + options_.setInlineVariables(true);
> + options_.setSmartNameRemoval(true);
> + options_.setRemoveDeadCode(true);
> + options_.setCheckMissingReturn(CheckLevel.WARNING);
> + options_.setExtractPrototypeMemberDeclarations(true);
> + options_.setRemoveUnusedPrototypeProperties(true);
> + options_.setRemoveUnusedPrototypePropertiesInExterns(true);
> + options_.setRemoveUnusedClassProperties(true);
> + options_.setRemoveUnusedVars(true);
> + options_.setRemoveUnusedLocalVars(true);
> + options_.setAliasExternals(true);
> + options_.setCollapseVariableDeclarations(true);
> + options_.setCollapseAnonymousFunctions(true);
> + options_.setAliasAllStrings(true);
> + options_.setConvertToDottedProperties(true);
> + options_.setRewriteFunctionExpressions(true);
> + options_.setOptimizeParameters(true);
> + options_.setOptimizeReturns(true);
> + options_.setOptimizeCalls(true);
> + options_.setOptimizeArgumentsArray(true);
> +
> + // warnings already activated in previous incarnation
> options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS,
> CheckLevel.WARNING);
> options_.setWarningLevel(DiagnosticGroups.CONST,
> CheckLevel.WARNING);
> options_.setWarningLevel(DiagnosticGroups.CONSTANT_PROPERTY,
> CheckLevel.WARNING);
>
> options_.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK,
> CheckLevel.WARNING);
> options_.setWarningLevel(DiagnosticGroups.VISIBILITY,
> CheckLevel.WARNING);
> options_.setWarningLevel(DiagnosticGroups.DEPRECATED,
> CheckLevel.OFF);
> +
> + /*
> + // the 'full' set of warnings
> +
> options_.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.CHECK_EVENTFUL_OBJECT_DISPOSAL,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.CHECK_PROVIDES,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.CHECK_REGEXP,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.CHECK_STRUCT_DICT_INHERITANCE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.CHECK_TYPES,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.CHECK_USELESS_CODE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.DUPLICATE_MESSAGE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.DUPLICATE_VARS,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.ES3,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.ES5_STRICT,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.GLOBAL_THIS,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.INTERNET_EXPLORER_CHECKS,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.INVALID_CASTS,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.LINT_CHECKS,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.MISPLACED_TYPE_ANNOTATION,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.MISSING_RETURN,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES,
> CheckLevel.OFF);
> + options_.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.REPORT_UNKNOWN_TYPES,
> CheckLevel.OFF);
> + options_.setWarningLevel(DiagnosticGroups.SUSPICIOUS_CODE,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.TWEAKS,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.TYPE_INVALIDATION,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES,
> CheckLevel.WARNING);
> +
> options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES,
> CheckLevel.WARNING);
> + options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS,
> CheckLevel.OFF);
> + options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE,
> CheckLevel.OFF);
> +
> options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP,
> CheckLevel.WARNING);
> + //*/
> }
>
> options_.sourceMapFormat = SourceMap.Format.V3;
>
>
--
Ix Multimedia Software
Jan Luykenstraat 27
3521 VB Utrecht
T. 06-51952295
I. www.ixsoftware.nl