jsbench 0.2.1

  • README.md
  • Installing
  • Versions
  • 50


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.

1. Depend on it

Add this to your package's pubspec.yaml file:

  jsbench: "^0.2.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

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


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


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


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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <2.0.0
archive ^1.0.30 1.0.33
args >=0.13.7 <2.0.0 1.3.0
glob ^1.1.5 1.1.5
kilobyte ^0.1.0 0.1.0+2
path ^1.0.0 1.5.1
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
meta 1.1.2
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test ^0.12.0