Giter Site home page Giter Site logo

jsperf / jsperf.com Goto Github PK

View Code? Open in Web Editor NEW
1.3K 44.0 129.0 1.76 MB

jsperf.com v2. https://github.com/h5bp/lazyweb-requests/issues/174

Home Page: https://jsperf.com/

License: MIT License

JavaScript 95.51% CSS 0.92% Dockerfile 0.03% Handlebars 3.54%
javascript benchmark benchmarking performance

jsperf.com's Introduction

jsperf.com Build Status Test Coverage Code Climate Reviewed by Hound

How to run a local copy of jsPerf

Prerequisites

  1. Node.js (see preferred version in .nvmrc)
  2. MySQL
  3. Install 1. macOS: brew install mysql
  4. Initialize: mysql -uroot -e "CREATE DATABASE jsperf; GRANT ALL ON jsperf.* TO 'jsuser'@'localhost' IDENTIFIED BY 'jspass'; FLUSH PRIVILEGES;"
  5. Get a Browserscope.org API key by signing in and going to the settings page.
  6. Register a new OAuth GitHub application. Leave the callback URL blank. Copy the "Client ID" and "Client Secret".

Setup

  1. Install dependencies: npm install
  2. Create a .env file (will be ignored by git) with the following variables (VAR_NAME=value):
NODE_ENV=development
# from Prerequisites step 2.2
MYSQL_USER=jsuser
MYSQL_PASSWORD=jspass
MYSQL_DATABASE=jsperf
# from Prerequisites step 3
BROWSERSCOPE=
# from Prerequisites step 4
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CALLBACK=http://localhost:3000

BELL_COOKIE_PASS=password-should-be-32-characters
COOKIE_PASS=password-should-be-32-characters

# customizable but not recommended for local development
# SCHEME=http
# DOMAIN=localhost
# PORT=3000
# MYSQL_HOST=localhost
# MYSQL_PORT=3306
# LOGGLY_TOKEN=
# LOGGLY_SUBDOMAIN=
# REDIS_HOST=
# REDIS_PORT=
# REDIS_PASSWORD=

Start

  • correct version of node
  • mysql running
  • .env created with your values
npm start

Hopefully everything smoothly started up and you're ready to start contributing. If not, check out the wiki for debugging tips.

Sponsorship

Development of jsperf.com is generously supported by contributions from individuals and corporations. If you are benefiting from jsPerf and would like to help keep the project financially sustainable, please visit https://jsperf.com/sponsor.

jsperf.com's People

Contributors

asilluron avatar aymkdn avatar bnjmnt4n avatar caitp avatar chessax avatar danez avatar devside avatar greenkeeper[bot] avatar greenkeeperio-bot avatar greggman avatar jdalton avatar madskonradsen avatar mathiasbynens avatar maxbeatty avatar mintbridge avatar orkon avatar ricordisamoa avatar salbertson avatar snyk-bot avatar swang avatar wardpeet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsperf.com's Issues

RSS removed/disabled?

I can no longer subscribe to a test on jsperf.com. Will the RSS feature ever come back?

Error on jsperf-dev on Heroku

The dev page errors with:

{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}

v2 development plan

Here's my plan for creating a new backend:

  1. Interpret what the PHP is doing
  2. Implement in JS here
  3. Remove translated bits
  4. Repeat until there's nothing left

It's going to be messy at times and later refactoring will be necessary. Please submit PRs 😺

If anyone knows of unused parts of the old backend, please submit a PR to my fork with what can be skipped.

If you think there's a better approach to creating a new backend, open to suggestions 🙏

Hosting recommendations?

Any recommendations for decent io.js + MySQL hosting?

Heroku? DigitalOcean? Any other recommendations?

Quoting h5bp/lazyweb-requests#174 (comment):

Guessing the free tier of Heroku won’t cut it. Hosting compatible with Node Could anyone donate hosting?

About hosting costs: I’ll continue to pay for it out of my own pocket. Hopefully in the future user donations could (help) pay for the hosting. Or perhaps a hosting company would be willing to donate a box for jsPerf?

GitHub OAuth error: redirect_uri_mismatch

While I was trying to get the project up and running locally, I stumbled upon an error when performing the GitHub authentication part. This is the error in full:

{
    "error": "redirect_uri_mismatch",
    "error_description": "The redirect_uri MUST match the registered callback URL for this application.",
    "error_uri": "https://developer.github.com/v3/oauth/#redirect-uri-mismatch",
    "state": "4Nz5n60BXDW9hoqlC9tjzv"
}

Per the README.md's recommendations, I had http://localhost:3000/ (the same URL as the server) as the authorization callback URL, which resulted in this error.

Adding 127.0.0.1 dev.jsperf.com to my /etc/hosts file and setting the callback URL to http://dev.jsperf.com managed to somewhat fix the issue: I got the GitHub auth prompt, and it redirected me to http://dev.jsperf.com/auth/github?code=XX&state=XX. Finally, by adding the port manually to that URL, jsperf saved those credentials and I can now use the application (except for not having a BrowserScope API key, but that's another issue).

My question here is: have I done something wrong (which is entirely possible since my knowledge of OAuth is severely lacking), or is there something missing in the documentation? If there is, I'll send a PR your way to correct any documentation if you could me point in the right direction.

Spam filters on browse pages

Each time I open browse page I find tons of spam. The spam filters, moderation or user's votes for spam would be great.

results graph

its dead on https, probably because browserscope doesnt have https

edit: oh #43

Local installation copy doesn't run tests

I've installed jsperf locally and things ran smooth on 'npm start'. However,

  • I wasn't able to do 'Run Tests' on localhost:3000. No console errors.
  • Looks like the app isnt picking up preparation code what I entered in the previous page.
  • The above mentioned behavior is consistent with other public tests that I tried to run on this machine,
    Test case is the one.

Please find attached screenshot of the error page.
jsperf error 1

Receiving error on simple script

I created a test on jsperf, but it shows an error, but not in my script:

Uncaught TypeError: Cannot read property 'name' of undefined.
  message: Uncaught TypeError: Cannot read property 'name' of undefined
  fileName: http://jsperf.com/benchmark-47.js
  lineNumber: 21

What is wrong with my test?

Logo / icon

At the moment, the jsPerf logo is:

However, there is no higher-resolution version of this logo. We need one.

Of course, suggestions for an alternate logo are welcome, too!

Couldn't load main-20150701.js

Right now there is a problem with loading a file named "main-20150701" and when adding a test suite, after clicking submit button nothing happens except for reloading of the page.

PS. There was a SSL Certificate problem while ago

Move test

Would be really cool if you could re-order the tests. When I have a bunch of tests and I discover that I forgot to add one somewhere, there's no way for me to add a new test and say "this one should come after THAT test".

spam: /browse filled with https-www-reddit-com-* "tests"

Noticed today, 2016.12.06, that most tests listed at http://jsperf.com/browse seem to be spam. They're all named some variant of
https-www-reddit-com- and have this code:

https://www.reddit.com/3vpna9
<script>
  Benchmark.prototype.setup = function() {
    https://www.reddit.com/3vpna9
  };

  Benchmark.prototype.teardown = function() {
    https://www.reddit.com/3vpna9
  };
</script>

https

its good that you support https but browserscope doesn't

And that's why it sometimes fails to load javascript (jsonp)

Loading cumulative results data…
The get/post request has failed :(

options are:

https://jsonp.afeld.me/?url=http%3A%2F%2Fwww.browserscope.org%2F%3Fcategory%3Dusertest_ahBzfnVhLXByb2ZpbGVyLWhychELEgRUZXN0GICAgJfZ_qAIDA%26v%3D3%26tqx%3DreqId%253A80%26o%3Djson

PS browserscope have json format aswell so you don't have to use insecure jsonp, the only thing you need is some CORS & https proxy witch https://jsonp.afeld.me offers

can't run local server

two reasons:

  1. setup script is invalid; needs a 'use strict'; at top
> [email protected] setup /Volumes/alien/projects/forked/jsperf.com
> node setup

/Volumes/alien/projects/forked/jsperf.com/setup/index.js:112
  let prop;
  ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:139:18)
    at node.js:999:3
  1. ...and it's seemingly incompatible with mysql 5.7.10 via homebrew:

    Connected to database...
    Successfully created database
    Granted permissions to your user
    Prepared to create tables
    /Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Parser.js:82
            throw err;
            ^
    
    Error: ER_COLLATION_CHARSET_MISMATCH: COLLATION 'utf8mb4_unicode_ci' is not valid for CHARACTER SET 'utf8'
        at Query.Sequence._packetToError (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14)
        at Query.ErrorPacket (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
        at Protocol._parsePacket (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Protocol.js:271:23)
        at Parser.write (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Parser.js:77:12)
        at Protocol.write (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Protocol.js:39:16)
        at Socket.<anonymous> (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/Connection.js:96:28)
        at emitOne (events.js:90:13)
        at Socket.emit (events.js:182:7)
        at readableAddChunk (_stream_readable.js:147:16)
        at Socket.Readable.push (_stream_readable.js:111:10)
        --------------------
        at Protocol._enqueue (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Protocol.js:135:48)
        at Connection.query (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/Connection.js:201:25)
        at /Volumes/alien/projects/forked/jsperf.com/setup/index.js:221:12
        at Array.forEach (native)
        at Handshake._callback (/Volumes/alien/projects/forked/jsperf.com/setup/index.js:218:36)
        at Handshake.Sequence.end (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
        at Handshake.Sequence.OkPacket (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/sequences/Sequence.js:105:8)
        at Protocol._parsePacket (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Protocol.js:271:23)
        at Parser.write (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Parser.js:77:12)
        at Protocol.write (/Volumes/alien/projects/forked/jsperf.com/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    

Add back DOMAIN and SCHEME

We still need DOMAIN, though. And SCHEME ('http' or 'https').

  • add DOMAIN environment variable
  • add SCHEME environment variable

probably through either config.js or manifest.js and then make available in the view engine default context

JSPerf still identifies Microsoft Edge as Google Chrome

I saw that there was an old issue which was resolved as a duplicate of a (seemingly unrelated) platform.js bug. But even that (again, seemingly unrelated) bug has been resolved for some time. So why does JSPerf still get tripped up by the Edge UA string? This should be an easy fix.

The path '/browse/{authorSlug}' does not work

The FAQ says the following:

How can I keep track of new or updated test cases made by a specific user?
Every author has its own Atom feed, located at http://jsperf.com/browse/author-name.atom. Omit the .atom suffix to get a clickable list instead. If you’re identified on jsPerf (i.e. if you’ve commented, or created/edited a test case), a “My tests” link will appear in the navigation.

The source code appears to support this feature.

However these URLs just redirect to the home page

I recently created a test under the name "styfle" in case my other tests were deleted, however still no luck.

Better debugging / repeated editing story

It's currently difficult to iterate on test development since (1) you're required to complete one (sometimes two!) captchas before seeing the results of a change, and (2) the test and results are on separate pages.

Just adding a 15 minute grace period between captchas would really help, though a better editing/debugging story overall would be nice.

Thanks for the site!

consider node-uap for user agent parsing

platform.js is in maintenance mode so I wouldn't mind handing off to uap-core by way of node-uap
jdalton

platform.js is currently used on the client to display the visitor's browser's name and version along with the OS on test pages. could replace with node-uap on the server

ES6 Destructuring ?

Test case: http://jsperf.com/compare-variable-swapping

FF44 supports ES6 destructuring. I see the following error in the page:

TypeError: P(...)[0] is undefined.

    message: TypeError: P(...)[0] is undefined
    fileName: http://jsperf.com/benchmark-47.js
    lineNumber: 21

I can not decide if the first case is so slow or the measured Ops/sec is invalid.

Spam samples

Could you provide some samples of the spam so we can help in building a better filter to protect against these?

Add ability to have a verification step

Have a step, basically in Teardown phase, that can verify the finished result of each of the tests.

I'd imagine we might be able to do it in Teardown somehow, but i'm not seeing any documentation on how to right now.

Site always runs captcha page

Hi @jsperf!
I'm using jsperf and after restore snippets site not working properly!
I'm using Kaspersky Anti-Virus (Windows 10 Multiple Edition), Android 4.1.2 (SGS2) and iOS9 and all shows same page when applying improvements!
Note: When i writing any text like lorem ipsum its appling else shows captcha page, i sure on my pc hasn't virus/marlware!

Sorry for my bad english

jsperf.com: 503 Service Temporarily Unavailable

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.2.22 (Debian) Server at jsperf.com Port 80

IE 9 not able to run test - Script error in benchmark-47.js

When I open http://jsperf.com/sql-js-vs-alasql-js/10 with chrome I get a big red box stating that

Uncaught TypeError: Cannot read property 'name' of undefined.

message: Uncaught TypeError: Cannot read property 'name' of undefined
fileName: http://jsperf.com/benchmark-47.js
lineNumber: 21

This test will run when I click Run tests

Using IE9 I get

Script error.
•message: Script error
•fileName: http://kripken.github.io/sql.js/js/sql.js
•lineNumber: 0

in a red box. Clicking Run tests will give a new error but the tests will not run

Automate building “wrapped” Benchmark.js

On jsPerf we have to use a special custom build of Benchmark.js to avoid creating more global variables than necessary (since it may interfere with people’s tests otherwise).

Historically we’ve used a very old/hacky/ugly build script for that: https://github.com/mathiasbynens/jsperf.com/blob/master/_tmp/build.php

The plan is to create a new standalone script:

cc @jdalton

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.