Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 11, 2021
0 parents commit dc9b584
Show file tree
Hide file tree
Showing 637 changed files with 66,056 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = tab
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

[*.{yml,yaml,json}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
44 changes: 44 additions & 0 deletions .github/workflows/compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Compare

on:
workflow_dispatch:
inputs:
base:
description: "Base webpack version (git)"
default: "v5.21.2"
required: true
current:
description: "current webpack version (git)"
default: "master"
required: true

jobs:
bench:
strategy:
case:
- minimal
- esbuild-three
scenario:
- development-default-build
- development-cached-build
- development-cached-pnp-build
- production-default-build
- production-cached-build
- production-source-map-build
- production-source-map-cached-build
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ matrix.case }}-${{ github.event.inputs.name }}
restore-keys: |
yarn-${{ matrix.case }}-
yarn-
- run: node bin/compare.js ${{ matrix.case }} ${{ matrix.scenario }} ${{ github.event.inputs.base }} ${{ github.event.inputs.current }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
cases/**/yarn.lock
*.log
.cache
.yarn
19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
useTabs: true,
tabWidth: 2,
overrides: [
{
files: "*.json",
options: {
parser: "json",
useTabs: false
}
},
{
files: "*.ts",
options: {
parser: "typescript"
}
}
]
};
25 changes: 25 additions & 0 deletions bin/compare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import compare from "../lib/compare.js";
import { formatDiffTable } from "../lib/utils.js";

const [
,
,
caseName = "minimal",
scenarioName = "development-default-build",
baseline = "v5.0.0",
current = "master",
] = process.argv;

(async () => {
const diff = await compare(caseName, scenarioName, {
runs: 20,
verboseSetup: true,
baselineDependencies: {
webpack: `webpack/webpack#${baseline}`,
},
dependencies: {
webpack: `webpack/webpack#${current}`,
},
});
console.log(formatDiffTable(diff));
})().catch((err) => console.error(err.stack));
14 changes: 14 additions & 0 deletions bin/measure-mean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import measure from "../lib/measure.js";

const [
,
,
caseName = "minimal",
scenarioName = "development-default-build",
] = process.argv;

(async () => {
console.log(
await measure(caseName, scenarioName, { runs: 20, verboseSetup: true })
);
})().catch((err) => console.error(err.stack));
18 changes: 18 additions & 0 deletions bin/measure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import measure from "../lib/measure.js";

const [
,
,
caseName = "minimal",
scenarioName = "development-default-build",
] = process.argv;

(async () => {
console.log(
await measure(caseName, scenarioName, {
verbose: true,
verboseSetup: true,
noStatistics: true,
})
);
})().catch((err) => console.error(err.stack));
13 changes: 13 additions & 0 deletions cases/esbuild-three/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "esbuild-three",
"scripts": {
"bench:setup": "ncp src/base src/copy1 --clobber && ncp src/base src/copy2 --clobber && ncp src/base src/copy3 --clobber && ncp src/base src/copy4 --clobber && ncp src/base src/copy5 --clobber && ncp src/base src/copy6 --clobber && ncp src/base src/copy7 --clobber && ncp src/base src/copy8 --clobber && ncp src/base src/copy9 --clobber && ncp src/base src/copy10 --clobber"
},
"dependencies": {
"webpack": "^5.21.2",
"webpack-cli": "^4.5.0"
},
"devDependencies": {
"ncp": "^2.0.0"
}
}
1 change: 1 addition & 0 deletions cases/esbuild-three/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy*
13 changes: 13 additions & 0 deletions cases/esbuild-three/src/base/Three.Legacy.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Geometry } from './core/Geometry';
import { Material } from './materials/Material';
import { Object3D } from './core/Object3D';
import { Scene } from './scenes/Scene';

export namespace SceneUtils {
export function createMultiMaterialObject(
geometry: Geometry,
materials: Material[]
): Object3D;
export function detach( child: Object3D, parent: Object3D, scene: Scene ): void;
export function attach( child: Object3D, scene: Scene, parent: Object3D ): void;
}
Loading

0 comments on commit dc9b584

Please sign in to comment.