Skip to content

Commit 8a73b4c

Browse files
📦 deps: Relocate deps specific to profiling and benchmarking.
1 parent 0fb92a7 commit 8a73b4c

File tree

10 files changed

+288
-62
lines changed

10 files changed

+288
-62
lines changed

_benchmark/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"bench": "node main.js"
5+
},
6+
"dependencies": {
7+
"@iterable-iterator/range": "^2.1.0",
8+
"argparse": "^2.0.1",
9+
"benchmark": "^2.1.4",
10+
"benchtable": "0.1.0",
11+
"fingertree": "^0.1.7",
12+
"list": "^2.0.19",
13+
"microtime": "^3.0.0"
14+
}
15+
}

_benchmark/yarn.lock

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
"@iterable-iterator/range@^2.1.0":
6+
version "2.1.0"
7+
resolved "https://registry.yarnpkg.com/@iterable-iterator/range/-/range-2.1.0.tgz#d7cfeee165c612f460c9ea1854a250f4788f1226"
8+
integrity sha512-3/jhQR2FVpur0RmrHCksePYsahdZcGh7WKukDkI1xq3gwzmCQm3Nv0MwKttMf3viUGq6mV0BUHXybpLLfMCeKA==
9+
10+
ansi-styles@^3.0.0:
11+
version "3.2.1"
12+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
13+
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
14+
dependencies:
15+
color-convert "^1.9.0"
16+
17+
ansy@^1.0.0:
18+
version "1.0.15"
19+
resolved "https://registry.yarnpkg.com/ansy/-/ansy-1.0.15.tgz#3915c82eb71aa8ddc37721c8c6db66d50d44c207"
20+
integrity sha512-mQyNSn58HN7aEthofkap0hn8jg7/5SJWrB0ypExgcECOwLppc0njH+QBA9X5VMiEN9SM0JlFZWJQGycxxInAqg==
21+
dependencies:
22+
ansi-styles "^3.0.0"
23+
custom-return "^1.0.0"
24+
supports-color "^3.1.2"
25+
ul "^5.2.1"
26+
27+
argparse@^2.0.1:
28+
version "2.0.1"
29+
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
30+
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
31+
32+
benchmark@^2.0.0, benchmark@^2.1.4:
33+
version "2.1.4"
34+
resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629"
35+
integrity sha1-CfPeMckWQl1JjMLuVloOvzwqVik=
36+
dependencies:
37+
lodash "^4.17.4"
38+
platform "^1.3.3"
39+
40+
41+
version "0.1.0"
42+
resolved "https://registry.yarnpkg.com/benchtable/-/benchtable-0.1.0.tgz#b32a7d8442798106c1bd95bb18ca6cc9f995ff1c"
43+
integrity sha1-syp9hEJ5gQbBvZW7GMpsyfmV/xw=
44+
dependencies:
45+
benchmark "^2.0.0"
46+
cli-table "^0.3.1"
47+
color-it "^1.2.0"
48+
49+
cli-table@^0.3.1:
50+
version "0.3.6"
51+
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.6.tgz#e9d6aa859c7fe636981fd3787378c2a20bce92fc"
52+
integrity sha512-ZkNZbnZjKERTY5NwC2SeMeLeifSPq/pubeRoTpdr3WchLlnZg6hEgvHkK5zL7KNFdd9PmHN8lxrENUwI3cE8vQ==
53+
dependencies:
54+
colors "1.0.3"
55+
56+
color-convert@^1.0.0, color-convert@^1.9.0:
57+
version "1.9.3"
58+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
59+
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
60+
dependencies:
61+
color-name "1.1.3"
62+
63+
color-it@^1.2.0:
64+
version "1.2.12"
65+
resolved "https://registry.yarnpkg.com/color-it/-/color-it-1.2.12.tgz#3be7c4e0c242b9b2e6c48312751f78645bdbe1cb"
66+
integrity sha512-15ymoygmMjfsrjfnxFcKGXk/7TFo0kuZ2ETBinKpBw4T4H5MZWDFa21fmwlwcJnOz4RzSGbYwi7lnUf2264vKw==
67+
dependencies:
68+
couleurs "^6.0.6"
69+
flat-colors "^3.1.0"
70+
iterate-object "^1.1.0"
71+
typpy "^2.3.3"
72+
73+
74+
version "1.1.3"
75+
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
76+
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
77+
78+
79+
version "1.0.3"
80+
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
81+
integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=
82+
83+
couleurs@^6.0.6:
84+
version "6.0.11"
85+
resolved "https://registry.yarnpkg.com/couleurs/-/couleurs-6.0.11.tgz#15aa838cba5df3036c01a1c782d40ca9ed47e480"
86+
integrity sha512-y5WUDtgQKw/tVViZCj3ACX8VseU0ONxiet8SRsE89uH4s/otRLXGOMymfVbKMFzedKOdxQpTcYWukRwkvgRYdw==
87+
dependencies:
88+
ansy "^1.0.0"
89+
color-convert "^1.0.0"
90+
iterate-object "^1.3.1"
91+
typpy "^2.3.1"
92+
93+
custom-return@^1.0.0:
94+
version "1.0.12"
95+
resolved "https://registry.yarnpkg.com/custom-return/-/custom-return-1.0.12.tgz#371bcda1f4baa63cd98c00e16b2d6523ba1b741e"
96+
integrity sha512-Xy6IlEV6gW5Iu4YRoQe0A5RG1mzezawcTXzAk7u28oB2UilRfbbOc1C7RmWE6AJ1inSm8gghCkIpo0LUQfLbvw==
97+
dependencies:
98+
noop6 "^1.0.0"
99+
100+
deffy@^2.2.2:
101+
version "2.2.4"
102+
resolved "https://registry.yarnpkg.com/deffy/-/deffy-2.2.4.tgz#53c1b5f59b58a58150b1c9de5529229875c4cc17"
103+
integrity sha512-pLc9lsbsWjr6RxmJ2OLyvm+9l4j1yK69h+TML/gUit/t3vTijpkNGh8LioaJYTGO7F25m6HZndADcUOo2PsiUg==
104+
dependencies:
105+
typpy "^2.0.0"
106+
107+
fingertree@^0.1.7:
108+
version "0.1.7"
109+
resolved "https://registry.yarnpkg.com/fingertree/-/fingertree-0.1.7.tgz#69a44f4a280f58ec3f157be767d5dfd0b05258c5"
110+
integrity sha1-aaRPSigPWOw/FXvnZ9Xf0LBSWMU=
111+
112+
flat-colors@^3.1.0:
113+
version "3.3.12"
114+
resolved "https://registry.yarnpkg.com/flat-colors/-/flat-colors-3.3.12.tgz#e93abe480cc3e78f9ea0563e3946f3162c849389"
115+
integrity sha512-SYIhhJ+ElZbyyz6+e+xpyN3EboppIg1h6nZaMyEeDwXSY6a3jjp/gANDBmj8xwu+mMflj4UWCPkxRIH+rExDMQ==
116+
117+
function.name@^1.0.3:
118+
version "1.0.13"
119+
resolved "https://registry.yarnpkg.com/function.name/-/function.name-1.0.13.tgz#eef045abc4b5ff4e3e9d001a53ce14e090c971c6"
120+
integrity sha512-mVrqdoy5npWZyoXl4DxCeuVF6delDcQjVS9aPdvLYlBxtMTZDR2B5GVEQEoM1jJyspCqg3C0v4ABkLE7tp9xFA==
121+
dependencies:
122+
noop6 "^1.0.1"
123+
124+
has-flag@^1.0.0:
125+
version "1.0.0"
126+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa"
127+
integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=
128+
129+
iterate-object@^1.1.0, iterate-object@^1.3.1:
130+
version "1.3.4"
131+
resolved "https://registry.yarnpkg.com/iterate-object/-/iterate-object-1.3.4.tgz#fa50b1d9e58e340a7dd6b4c98c8a5e182e790096"
132+
integrity sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==
133+
134+
list@^2.0.19:
135+
version "2.0.19"
136+
resolved "https://registry.yarnpkg.com/list/-/list-2.0.19.tgz#370a3d7d3e24cfd5ced2c89cda2baf28e31e2830"
137+
integrity sha512-nnVaRp4RaMAQkCpypTThsdxKqgPMiSwJq93eAm2/IbpUa8sd04XKBhkKu+bMk63HmdjK8b8Cuh4xARHWX2ye/Q==
138+
139+
lodash@^4.17.4:
140+
version "4.17.21"
141+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
142+
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
143+
144+
microtime@^3.0.0:
145+
version "3.0.0"
146+
resolved "https://registry.yarnpkg.com/microtime/-/microtime-3.0.0.tgz#d140914bde88aa89b4f9fd2a18620b435af0f39b"
147+
integrity sha512-SirJr7ZL4ow2iWcb54bekS4aWyBQNVcEDBiwAz9D/sTgY59A+uE8UJU15cp5wyZmPBwg/3zf8lyCJ5NUe1nVlQ==
148+
dependencies:
149+
node-addon-api "^1.2.0"
150+
node-gyp-build "^3.8.0"
151+
152+
node-addon-api@^1.2.0:
153+
version "1.7.2"
154+
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d"
155+
integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==
156+
157+
node-gyp-build@^3.8.0:
158+
version "3.9.0"
159+
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25"
160+
integrity sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==
161+
162+
noop6@^1.0.0, noop6@^1.0.1:
163+
version "1.0.9"
164+
resolved "https://registry.yarnpkg.com/noop6/-/noop6-1.0.9.tgz#8749944c15c09f2cd2d562ac24f5a8341762a950"
165+
integrity sha512-DB3Hwyd89dPr5HqEPg3YHjzvwh/mCqizC1zZ8vyofqc+TQRyPDnT4wgXXbLGF4z9YAzwwTLi8pNLhGqcbSjgkA==
166+
167+
platform@^1.3.3:
168+
version "1.3.6"
169+
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
170+
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
171+
172+
supports-color@^3.1.2:
173+
version "3.2.3"
174+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
175+
integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=
176+
dependencies:
177+
has-flag "^1.0.0"
178+
179+
typpy@^2.0.0, typpy@^2.3.1, typpy@^2.3.3, typpy@^2.3.4:
180+
version "2.3.13"
181+
resolved "https://registry.yarnpkg.com/typpy/-/typpy-2.3.13.tgz#7e16a3aa83d7eecdfbd5ee615b9ffd785887ee7e"
182+
integrity sha512-vOxIcQz9sxHi+rT09SJ5aDgVgrPppQjwnnayTrMye1ODaU8gIZTDM19t9TxmEElbMihx2Nq/0/b/MtyKfayRqA==
183+
dependencies:
184+
function.name "^1.0.3"
185+
186+
ul@^5.2.1:
187+
version "5.2.15"
188+
resolved "https://registry.yarnpkg.com/ul/-/ul-5.2.15.tgz#426425355ae15df2d5d09b351aade26ed06dd9ed"
189+
integrity sha512-svLEUy8xSCip5IWnsRa0UOg+2zP0Wsj4qlbjTmX6GJSmvKMHADBuHOm1dpNkWqWPIGuVSqzUkV3Cris5JrlTRQ==
190+
dependencies:
191+
deffy "^2.2.2"
192+
typpy "^2.3.4"

_profile/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Generated files
2+
/dist
3+
/v8-deopt-viewer

_profile/append.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
console.time('prepare');
2-
require('regenerator-runtime/runtime');
3-
const ArgumentParser = require('argparse').ArgumentParser;
4-
const range = require('@iterable-iterator/range').range;
5-
const empty = require('..').empty;
1+
import 'regenerator-runtime/runtime.js';
2+
import {ArgumentParser} from 'argparse';
3+
import {range} from '@iterable-iterator/range';
4+
import {FAST_COUNTER as COUNTER} from '../test/src/_fixtures.js';
5+
import {empty} from './dist/profile/index.js';
66

7-
const COUNTER = {
8-
plus(a, b) {
9-
return a + b;
10-
},
11-
measure(_x) {
12-
return 1;
13-
},
14-
zero() {
15-
return 0;
16-
},
17-
};
7+
console.time('prepare');
188

199
const parser = new ArgumentParser();
2010
parser.add_argument('M', {default: 1000, nargs: '?'});
@@ -28,6 +18,7 @@ console.log('number of operations:', M * N);
2818
const t = empty(COUNTER);
2919
console.timeEnd('prepare');
3020

21+
const r = range(M);
3122
console.time('append');
32-
for (let k = 0; k < N; ++k) t.append(range(M));
23+
for (let k = 0; k < N; ++k) t.append(r);
3324
console.timeEnd('append');

_profile/babel.config.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"bugfixes": true,
7+
"modules": false,
8+
"targets": {
9+
"esmodules": true
10+
}
11+
}
12+
]
13+
],
14+
"plugins": [
15+
[
16+
"transform-remove-console",
17+
{
18+
"exclude": [
19+
"log",
20+
"error",
21+
"warn"
22+
]
23+
}
24+
]
25+
],
26+
"env": {
27+
"profile": {
28+
"plugins": [
29+
"babel-plugin-unassert"
30+
]
31+
}
32+
}
33+
}

_profile/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "module",
3+
"scripts": {
4+
"build-cmd": "babel --delete-dir-on-start",
5+
"build:profile": "yarn build-cmd --env-name profile --out-dir dist/profile ../src",
6+
"profile": "sh profile.sh"
7+
},
8+
"dependencies": {
9+
"@iterable-iterator/range": "^2.1.0",
10+
"argparse": "^2.0.1"
11+
}
12+
}

_profile/profile.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
TIMESTAMP="$(date '+%Y-%m-%dT%H:%M:%S')"
4+
5+
logfile="$(printf '%s-' "$@")${TIMESTAMP}-v8.log"
6+
7+
node --prof --logfile="$logfile" "$@"

_profile/yarn.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
"@iterable-iterator/range@^2.1.0":
6+
version "2.1.0"
7+
resolved "https://registry.yarnpkg.com/@iterable-iterator/range/-/range-2.1.0.tgz#d7cfeee165c612f460c9ea1854a250f4788f1226"
8+
integrity sha512-3/jhQR2FVpur0RmrHCksePYsahdZcGh7WKukDkI1xq3gwzmCQm3Nv0MwKttMf3viUGq6mV0BUHXybpLLfMCeKA==
9+
10+
argparse@^2.0.1:
11+
version "2.0.1"
12+
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
13+
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,19 @@
8383
"@iterable-iterator/reversed": "1.0.0",
8484
"@iterable-iterator/tee": "2.0.0",
8585
"@js-library/commitlint-config": "0.0.4",
86-
"argparse": "2.0.1",
8786
"ava": "3.15.0",
8887
"babel-plugin-transform-remove-console": "6.9.4",
8988
"babel-plugin-unassert": "3.2.0",
9089
"babel-preset-power-assert": "3.0.0",
91-
"benchmark": "2.1.4",
9290
"c8": "7.10.0",
9391
"esdoc": "1.1.0",
9492
"esdoc-inject-script-plugin": "1.0.0",
9593
"esdoc-inject-style-plugin": "1.0.0",
9694
"esdoc-standard-plugin": "1.0.0",
97-
"fingertree": "0.1.7",
9895
"fixpack": "4.0.0",
9996
"husky": "7.0.4",
10097
"lint-staged": "12.1.2",
10198
"microbundle": "0.14.2",
102-
"microtime": "3.0.0",
10399
"np": "7.6.0",
104100
"pinst": "2.1.6",
105101
"power-assert": "1.6.1",

0 commit comments

Comments
 (0)