Skip to content

Commit

Permalink
Add bench code and result (#27)
Browse files Browse the repository at this point in the history
* feat: add bench code and result

* feat: remove .state.json
  • Loading branch information
okoala authored Dec 16, 2017
1 parent 7fe916e commit 458c810
Show file tree
Hide file tree
Showing 27 changed files with 347 additions and 14 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ _site
**/avet-client/lib
**/avet-utils/lib

*.lerna_backup
*.lerna_backup

asset-prod
bench/**/build
bench/**/.isomorphic

.next
.stats.json
21 changes: 21 additions & 0 deletions bench/avet-big/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```bash
[Sat Dec 16 2017 20:37:56 GMT+0800 (CST)] INFO Requests: 0 (0%), requests per second: 0, mean latency: 0 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Target URL: http://127.0.0.1:3000
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Max requests: 50
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Concurrency level: 10
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Agent: none
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Completed requests: 50
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Total errors: 0
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Total time: 2.511741034 s
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Requests per second: 20
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Mean latency: 459.7 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO Percentage of the requests served within a certain time
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO 50% 477 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO 90% 564 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO 95% 564 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO 99% 565 ms
[Sat Dec 16 2017 20:37:59 GMT+0800 (CST)] INFO 100% 565 ms (longest request)
```
11 changes: 11 additions & 0 deletions bench/avet-big/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "bench-avet-big",
"version": "1.0.0-15",
"scripts": {
"start": "avet-bin build && avet-bin start"
},
"devDependencies": {
"avet": "1.0.0-15",
"avet-bin": "1.0.0-15"
}
}
13 changes: 13 additions & 0 deletions bench/avet-big/page/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

export default () => {
return <ul>{items()}</ul>;
};

const items = () => {
const out = new Array(10000);
for (let i = 0; i < out.length; i++) {
out[i] = <li key={i}>This is row {i + 1}</li>;
}
return out;
};
21 changes: 21 additions & 0 deletions bench/avet-simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```bash
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Requests: 0 (0%), requests per second: 0, mean latency: 0 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Target URL: http://127.0.0.1:3000
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Max requests: 50
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Concurrency level: 10
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Agent: none
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Completed requests: 50
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Total errors: 0
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Total time: 0.104411828 s
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Requests per second: 479
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Mean latency: 17.9 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO Percentage of the requests served within a certain time
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO 50% 18 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO 90% 22 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO 95% 23 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO 99% 24 ms
[Sat Dec 16 2017 20:45:49 GMT+0800 (CST)] INFO 100% 24 ms (longest request)
```
11 changes: 11 additions & 0 deletions bench/avet-simple/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "bench-avet",
"version": "1.0.0-15",
"scripts": {
"start": "avet-bin build && avet-bin start"
},
"devDependencies": {
"avet": "1.0.0-15",
"avet-bin": "1.0.0-15"
}
}
1 change: 1 addition & 0 deletions bench/avet-simple/page/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => <h1>My component!</h1>
3 changes: 3 additions & 0 deletions bench/beidou-big/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["beidou-server"]
}
10 changes: 10 additions & 0 deletions bench/beidou-big/bin/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict'; // eslint-disable-line
const path = require('path');

const beidou = require('beidou-core');

beidou.startCluster({
port: 3000,
baseDir: path.join(__dirname, '..'),
workers: 1,
});
17 changes: 17 additions & 0 deletions bench/beidou-big/client/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

export default class View extends React.Component {
static doctype = '<!DOCTYPE html>';

render() {
return <ul>{items()}</ul>;
}
}

const items = () => {
const out = new Array(10000);
for (let i = 0; i < out.length; i++) {
out[i] = <li key={i}>This is row {i + 1}</li>;
}
return out;
};
11 changes: 11 additions & 0 deletions bench/beidou-big/config/config.default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
keys: 'secrets',
isomorphic: {
universal: {
assets: [ '.css' ],
},
},
react: {
assetPath: '/public/',
},
};
8 changes: 8 additions & 0 deletions bench/beidou-big/config/config.local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function() {
const exports = {
react: {
assetPath: '/build/',
},
};
return exports;
};
32 changes: 32 additions & 0 deletions bench/beidou-big/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "bench-beidou-big",
"version": "0.3.3",
"scripts": {
"start": "beidou-build && node ./bin/server.js"
},
"author": "",
"devDependencies": {
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"css-loader": "~0.23.1",
"eslint": "^4.11.0",
"eslint-config-beidou": "^1.0.0",
"extract-text-webpack-plugin": "^3.0.2",
"globby": "^6.1.0",
"husky": "^0.13.4",
"react-hot-loader": "^3.1.3",
"style-loader": "^0.19.0",
"webpack-hot-middleware": "^2.21.0"
},
"dependencies": {
"babel-preset-beidou-client": "^0.1.0",
"babel-preset-beidou-server": "^0.1.0",
"beidou-core": "^0.3.3",
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"engines": {
"node": ">= 6.0.0"
},
"license": "MIT"
}
21 changes: 21 additions & 0 deletions bench/beidou-simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```bash
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Requests: 0 (0%), requests per second: 0, mean latency: 0 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Target URL: http://127.0.0.1:3000
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Max requests: 50
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Concurrency level: 10
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Agent: none
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Completed requests: 50
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Total errors: 0
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Total time: 0.465302078 s
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Requests per second: 107
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Mean latency: 84.6 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO Percentage of the requests served within a certain time
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO 50% 91 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO 90% 97 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO 95% 98 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO 99% 99 ms
[Sat Dec 16 2017 20:40:44 GMT+0800 (CST)] INFO 100% 99 ms (longest request)
```
10 changes: 10 additions & 0 deletions bench/beidou-simple/bin/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict'; // eslint-disable-line
const path = require('path');

const beidou = require('beidou-core');

beidou.startCluster({
port: 3000,
baseDir: path.join(__dirname, '..'),
workers: 1,
});
9 changes: 9 additions & 0 deletions bench/beidou-simple/client/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export default class View extends React.Component {
static doctype = '<!DOCTYPE html>';

render() {
return <h1>My component!</h1>;
}
}
11 changes: 11 additions & 0 deletions bench/beidou-simple/config/config.default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
keys: 'secrets',
isomorphic: {
universal: {
assets: [ '.css' ],
},
},
react: {
assetPath: '/public/',
},
};
8 changes: 8 additions & 0 deletions bench/beidou-simple/config/config.local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function() {
const exports = {
react: {
assetPath: '/build/',
},
};
return exports;
};
32 changes: 32 additions & 0 deletions bench/beidou-simple/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "bench-beidou-big",
"version": "0.3.3",
"scripts": {
"start": "beidou-build && node ./bin/server.js"
},
"author": "",
"devDependencies": {
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"css-loader": "~0.23.1",
"eslint": "^4.11.0",
"eslint-config-beidou": "^1.0.0",
"extract-text-webpack-plugin": "^3.0.2",
"globby": "^6.1.0",
"husky": "^0.13.4",
"react-hot-loader": "^3.1.3",
"style-loader": "^0.19.0",
"webpack-hot-middleware": "^2.21.0"
},
"dependencies": {
"babel-preset-beidou-client": "^0.1.0",
"babel-preset-beidou-server": "^0.1.0",
"beidou-core": "^0.3.3",
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"engines": {
"node": ">= 6.0.0"
},
"license": "MIT"
}
21 changes: 21 additions & 0 deletions bench/next-big/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```bash
[Sat Dec 16 2017 20:36:04 GMT+0800 (CST)] INFO Requests: 0 (0%), requests per second: 0, mean latency: 0 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Target URL: http://127.0.0.1:3000
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Max requests: 50
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Concurrency level: 10
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Agent: none
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Completed requests: 50
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Total errors: 0
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Total time: 1.8213076780000002 s
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Requests per second: 27
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Mean latency: 352.3 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO Percentage of the requests served within a certain time
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO 50% 337 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO 90% 471 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO 95% 472 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO 99% 473 ms
[Sat Dec 16 2017 20:36:06 GMT+0800 (CST)] INFO 100% 473 ms (longest request)
```
12 changes: 12 additions & 0 deletions bench/next-big/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "bench-next",
"version": "1.0.0-15",
"scripts": {
"start": "NODE_ENV=production next build && NODE_ENV=production next start"
},
"dependencies": {
"next": "4.3.0-canary.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}
13 changes: 13 additions & 0 deletions bench/next-big/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

export default () => {
return <ul>{items()}</ul>;
};

const items = () => {
const out = new Array(10000);
for (let i = 0; i < out.length; i++) {
out[i] = <li key={i}>This is row {i + 1}</li>;
}
return out;
};
21 changes: 21 additions & 0 deletions bench/next-simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```bash
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Requests: 0 (0%), requests per second: 0, mean latency: 0 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Target URL: http://127.0.0.1:3000
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Max requests: 50
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Concurrency level: 10
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Agent: none
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Completed requests: 50
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Total errors: 0
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Total time: 0.078080892 s
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Requests per second: 640
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Mean latency: 13.4 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO Percentage of the requests served within a certain time
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO 50% 11 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO 90% 23 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO 95% 24 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO 99% 27 ms
[Sat Dec 16 2017 20:43:29 GMT+0800 (CST)] INFO 100% 27 ms (longest request)
```
12 changes: 12 additions & 0 deletions bench/next-simple/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "bench-next",
"version": "1.0.0-15",
"scripts": {
"start": "NODE_ENV=production next build && NODE_ENV=production next start"
},
"dependencies": {
"next": "4.3.0-canary.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}
3 changes: 3 additions & 0 deletions bench/next-simple/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import React from 'react';

export default () => <h1>My component!</h1>;
16 changes: 4 additions & 12 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,13 @@
},
"commands": {
"build": {
"scope": [
"avet-shared",
"avet-client",
"avet-utils"
]
"scope": ["avet-shared", "avet-client", "avet-utils"]
},
"publish": {
"ignore": []
"ignore": ["bench/*"]
}
},
"packages": [
"packages/*"
],
"packages": ["packages/*", "bench/*"],
"npmClient": "npm",
"npmClientArgs": [
"--no-lockfile"
]
"npmClientArgs": ["--no-lockfile"]
}
Loading

0 comments on commit 458c810

Please sign in to comment.