• Stars
    star
    519
  • Rank 85,261 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ES6 polyfill vs. feature performance tests

six-speed

ES6 polyfill vs. feature performance tests.

Report is located at http://kpdecker.github.io/six-speed/

Usage

npm run test:sauce

Test against all registered Sauce Labs browsers.

npm run test:node

Tests against the current node version.

npm run profile:node -- --testName=$name --type=$type --count=$iterationCount

Profiles a given test within the current Node environment. Type may be one of:

  • babel
  • babel-runtime
  • babel-loose
  • typescript
  • es5
  • es6
npm run build

Builds test files into build directory.

npm start

Starts a server instance for manual browser testing. Tests may be accessed via http://machineName:9999/ and the # component may be used to filter the tests to be executed, i.e. http://machineName:9999/#promises

Profiling of specific tests may be done through http://machineName:9999/profile.html?testName=$testName&type=$type&count=$number, i.e. http://localhost:9999/profile.html?testName=generator&type=babel&count=1000000.

Firefox browsers need to use /moz/index.html and /moz/profile.html respectively to enable all supported ES6 features.

npm run report

Generates the data report.

Testing methodology

For each of the ES6 features in question, an ES5 implementation of that functionality was written along with an ES6 version. It should be noted that the functionality is frequently the same, but in some cases the "common" vs. "correct" version was written, i.e. using x[key] = value vs. defineProperty which is faster but can be hit but a particular nasty edge case for those who deem it fun to extend Object.prototype.

Babel, in both loose+runtime and runtime mode, and Babel was then used to compile the ES6 version to an ES5 compliant version, utilizing the runtime over polyfill to maintain test isolation and avoid native implementations where possible.

All of these test instances were then benchmarked in the given JavaScript engine using Benchmark.js and then the operations per second compared to the ES5 implementation. Cross browser and cross execution comparisons are avoided as much as possible to isolate environmental issues when executing on VMs in the cloud.

Test Steps

  1. ./bin/test-all.sh
  2. npm run report
  3. Checkin changes to site sub-repository.

VM Setup

The Windows 10 VM used must be manually setup to ensure the proper state prior to testing. This can be done with this command:

mkdir browsers
./node_modules/.bin/browser-downloader vm ./browsers

After this the image should be restarted a few times until all setup and update processes have completed and then a snapshot named six-speed taken from the idle desktop screen. The test-all.sh script will check that the VM image is up to date and will halt execution if the image is not setup properly, as a sanity check.

Adding a custom browser to the report

  • Run the server (npm run build && npm start)
  • Visit the test url in your browser to perform the tests
  • This updates data.json to include the results
  • Update notes.json to include the useragent and engine
  • Run the report builder (npm run report)
    • Report is generated in site/index.html

Links

Thanks

Thanks to BrowserStack and Sauce Labs for providing open source accounts which the majority of this testing was performed on.

More Repositories

1

jsdiff

A javascript text differencing implementation.
JavaScript
7,773
star
2

border-image-generator

WYSIWYG editor for border-image styles
JavaScript
97
star
3

gradient-scanner

CSS gradient generation tool
JavaScript
36
star
4

dogeon

DSON serialization such read much write wow wow wow
JavaScript
13
star
5

es6-module-packager

ES6 module linking tool
JavaScript
12
star
6

source-map-lookup

Simple script to map source-maped file location to the original source file.
JavaScript
8
star
7

stylus-images

Image linking utilities for Stylus
JavaScript
8
star
8

react-query-selector

React Component selector engine.
JavaScript
8
star
9

ALCE

Human friendly, machine editable, JSON-like config file format.
JavaScript
5
star
10

text-indexer

Javascript-based Text Indexer
JavaScript
5
star
11

git-todo

Git repository status scanner
JavaScript
5
star
12

firediff

Firebug change tracking extension
JavaScript
5
star
13

fireformat

Firebug text output formatter
JavaScript
4
star
14

nycdevday

Example code from webOS 2.0 Features presentation
JavaScript
4
star
15

amo-version-reduce

Simple utility that reduces the detailed host application version statistics
JavaScript
3
star
16

heroku-buildpack-lumbar

Heroku Buildpack for Lumbar projects
Shell
3
star
17

user-image-cache

Javascript Local Image Caching Library
3
star
18

githubpub

PubNub endpoint for Github Post-Receive URLs
JavaScript
3
star
19

stage-inspect

webOS Multi-stage inspector selector
2
star
20

mock-server-meetup

mock-server example application
JavaScript
2
star
21

demo

demo.incaseofstairs.com source
JavaScript
2
star
22

dotfiles

dotfiles
Shell
2
star
23

i18nScanner

Scans Mojo projects for i18n tokens
JavaScript
2
star
24

refractor

Image optimization AB tool
JavaScript
1
star
25

linoleum-webpack

Webpack build infrastructure for Linoleum projects.
JavaScript
1
star
26

carahue

Declarative style diffing tool
JavaScript
1
star
27

webos-fbSeedStatus

Sample application demonstrating update status seeding for Facebook for webOS
JavaScript
1
star
28

firefocus

Firebug focus tracking extension
JavaScript
1
star
29

rwMap

Chicago Restaurant Week Maps Mashup
JavaScript
1
star
30

symbolism

TypeScript
1
star
31

lumbar-style-doc

Style documentation generation plugin for lumbar
JavaScript
1
star
32

device-size-check

Browserscope script for collecting on-device browser height and width information.
JavaScript
1
star
33

linoleum

Recall javascript build infrastructure
JavaScript
1
star
34

generator-release

Yeoman generator for handling Bower/NPM releases.
JavaScript
1
star