jsbench 0.2.1

  • README.md
  • Installing
  • Versions
  • 53


A minimal Dart -> JavaScript size and performance tool.

This library assumes you are either using pub build or a similar tool to generate .dart.js files from .dart files, but otherwise makes no other assumptions. It is recommended to use --dump-info to output additional information about the compilation.


The following is an example of running jsbench on this repository:

$ pub build
$ pub run jsbench
main.dart.js35.9 kB
compiler overhead16.6 kB46.1%
dart:_js_helper10.9 kB30.3%
dart:html3.39 kB09.4%
dart:core2.47 kB06.9%
dart:_interceptors2.06 kB05.7%


This tool should either be used via pub global activate or as part of your dev_dependencies.

Then, build your application, and run jsbench. For example:

$ pub build
$ pub run jsbench

To get more interesting information (not just disk size), add --dump-info:

  - $dart2js:
          - --dump-info

See this packages' pubspec.yaml for an example.

If you want more information check out dump-info-visualizer.


--no-dump: Ignores all .info.json files on disk.

--no-collapse-package: Do not collapse all package:<name> libraries.

--dump-trivial-size: Threshold number of bytes to print out a library name.

--input: Glob pattern(s) to find emitted JavaScript files.

--exclude Glob pattern(s) to exclude when finding inputs.

--archive: Archive formats to recursively read from when finding inputs. Only tar is currently supported.


  • Supports reading from the .tar file format when --archive=tar is passed.

This is an experimental feature that has only been tested on UNIX systems; it allows listing and reading files from within supported archive formats as-if the archive was just a folder on disk. Imagine the following:


Previously, jsbench would only "see" output/bar.dart.js.

Now, jsbench --archive=tar would also read the contents of build.tar and process as-if build.tar was actually the name of a folder. So, if there was a .dart.js file in, it would also be found and processed by jsbench.


  • Collapses libraries from a package. Use --no-collapse-package to opt-out.


  • Initial commit. See README.md for example usage.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate jsbench

2. Use it

The package has the following executables:

$ jsbench
Version Uploaded Documentation Archive
0.2.1 Nov 6, 2017 Go to the documentation of jsbench 0.2.1 Download jsbench 0.2.1 archive
0.2.0 Nov 5, 2017 Go to the documentation of jsbench 0.2.0 Download jsbench 0.2.0 archive
0.1.0 Nov 5, 2017 Go to the documentation of jsbench 0.1.0 Download jsbench 0.1.0 archive


We analyzed this package on Jun 22, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
7 / 100
Code health derived from static analysis. [more]
99 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in libraries.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use jsbench.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Strong-mode analysis of lib/src/archives.dart gave the following hint:

    line: 42 col: 56
    'UTF8' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/finder.dart gave the following hint:

    line: 63 col: 56
    'UTF8' is deprecated and shouldn't be used.

    Similar analysis of the following files failed:

    • lib/src/output.dart (hint)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <2.0.0
archive ^1.0.30 1.0.33 2.0.0
args >=0.13.7 <2.0.0 1.4.3
glob ^1.1.5 1.1.6
kilobyte ^0.1.0 0.1.0+2
path ^1.0.0 1.6.1
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
convert 2.0.1
crypto 2.0.5
meta 1.1.5
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test ^0.12.0