Skip to content

dart2js: reduce unminified names in .js files #25003

@rakudrama

Description

@rakudrama

There are some common unminified properties in minified code.

Quick analysis of potential savings of an Angular2 + Dart app (compiled with --fast-startup)

Minify $requiredArgCount, $defaultValues, $signature: 1.64%
Minify inherit and installTearOff: 1.66%

Replace most common $signature with references to shared function: 1.5%
171 $signature:function(){return{func:1,args:[,,]}}
180 $signature:function(){return{func:1}}
415 $signature:function(){return{func:1,args:[,]}}

Replace most common $defaultValues:function(){return[]} with reference to shared function: 0.62%

Hopefully references to a shared function would parse faster than functions.

That is 3.3% with simply minifying helper function names and 5.4% with some other simple tricks.
I don't expect that the gzipped file will be smaller.
Subtract 1.66% for the standard emitter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-optimizationtype-enhancementA request for a change that isn't a bugweb-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions