• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 2 years 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://fhinkel.github.io/six-speed/

Quick start

clone, npm install, npm start. Open localhost:9999/#destructuring to see timings for all tests related to destructuring. We currently only care about es5 vs es6.

Generated files are in build. If you makes changes to checked in tests, don't forget to run ./node_modules/gulp/bin/gulp.js build.

On 403 or 404, run ./node_modules/gulp/bin/gulp.js build and maybe npm run test.

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
  • traceur
  • typescript
  • es5
  • es6
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 Traceur were 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.

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

type-profile

Collect runtime type information 😻 of your JavaScript code.
JavaScript
528
star
2

InteractiveShell

Build web apps for interactive command-line tools
HTML
27
star
3

javascript-vs-native-addon-prime-numbers

Speed up your Node.js App with Native Addons. What’s faster, C++ or JavaScript?
JavaScript
27
star
4

Presentations

24
star
5

AdventOfCode2018

https://adventofcode.com/
JavaScript
13
star
6

nodejs-hello-world

Hello World example
JavaScript
11
star
7

twitch

Code samples from twitch.tv/fhinkel
JavaScript
11
star
8

git-bisect-demo

Practice git-bisect.
JavaScript
10
star
9

PerformanceProfiling

Slides for Performance Profiling for V8
JavaScript
9
star
10

configs

Shell
5
star
11

JSEnginesExamples

Examples for JavaScript Engines Talk
JavaScript
4
star
12

beertopeer

Real-time, cross-border, multi-currency, and low-cost payments by leveraging existing crypto currency technologies
JavaScript
3
star
13

blog

TypeScript
2
star
14

V8AndNode

2
star
15

create-download-link

Create a link to download a text file.
JavaScript
2
star
16

PlantSimLab

Graphviz (DOT)
2
star
17

tryM2

Deprecated (Macaulay2 Interactive website)
HTML
2
star
18

Node.js-10

Node.js 10 workshop
JavaScript
1
star
19

fhinkel.github.io

HTML
1
star
20

concat2015

Slides for talk at Conc.at() 2015: Mobile web apps with "native app" features
CSS
1
star
21

SimLab

JavaScript
1
star
22

ConfigFiles

Bash config files
Shell
1
star
23

nextjs-blog

TypeScript
1
star
24

nextjs-starter

JavaScript
1
star
25

set-caret-position

Selection or full line of text if nothing selected.
JavaScript
1
star
26

ModernNodejsLegacy

JavaScript
1
star
27

control-compute-engine

JavaScript
1
star