Skip to content
Permalink
Browse files
Additional bench tracing improvements (#29325)
  • Loading branch information
timneutkens committed Sep 27, 2021
1 parent 7f99895 commit 3375e663243623c08d083368f00b4c41f450563b
Showing with 39 additions and 15 deletions.
  1. +27 −9 .vscode/launch.json
  2. +1 −0 bench/nested-deps/.gitignore
  3. +4 −0 bench/nested-deps/next.config.js
  4. +4 −3 bench/nested-deps/package.json
  5. +3 −3 packages/next/trace/trace.ts
@@ -10,21 +10,27 @@
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "dev", "test/integration/basic"],
"runtimeArgs": ["run", "debug", "dev", "bench/nested-deps"],
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"port": 9229
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
},
{
"name": "Launch app build",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "build", "test/integration/basic"],
"runtimeArgs": ["run", "debug", "build", "bench/nested-deps"],
"skipFiles": ["<node_internals>/**"],
"port": 9229,
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"]
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
},
{
"name": "Launch app build trace jaeger",
@@ -35,25 +41,34 @@
"runtimeArgs": ["run", "clean-trace-jaeger"],
"skipFiles": ["<node_internals>/**"],
"port": 9229,
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"]
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
},
{
"name": "Launch app production",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "start", "test/integration/basic"],
"runtimeArgs": ["run", "debug", "start", "bench/nested-deps"],
"skipFiles": ["<node_internals>/**"],
"port": 9229
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
},
{
"type": "node",
"request": "attach",
"name": "Attach to existing debugger",
"port": 9229,
"skipFiles": ["<node_internals>/**"],
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"]
"outFiles": ["${workspaceFolder}/packages/next/dist/**/*"],
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
},
{
"name": "Launch this example",
@@ -63,7 +78,10 @@
"runtimeExecutable": "yarn",
"runtimeArgs": ["run", "debug", "dev", "${fileDirname}"],
"skipFiles": ["<node_internals>/**"],
"port": 9229
"port": 9229,
"env": {
"NEXT_PRIVATE_LOCAL_WEBPACK5": "1"
}
}
]
}
@@ -1 +1,2 @@
components/*
CPU*
@@ -2,6 +2,10 @@ module.exports = {
eslint: {
ignoreDuringBuilds: true,
},
webpack(config) {
config.module.unsafeCache = true
return config
},
experimental: {
swcLoader: true,
swcMinify: true,
@@ -1,10 +1,11 @@
{
"scripts": {
"prepare": "rm -rf components && mkdir components && node ./fuzzponent.js -d 2 -s 206 -o components",
"dev": "../../node_modules/.bin/next dev",
"build": "../../node_modules/.bin/next build",
"start": "../../node_modules/.bin/next start",
"dev": "NEXT_PRIVATE_LOCAL_WEBPACK5=1 ../../node_modules/.bin/next dev",
"build": "NEXT_PRIVATE_LOCAL_WEBPACK5=1 ../../node_modules/.bin/next build",
"start": "NEXT_PRIVATE_LOCAL_WEBPACK5=1 ../../node_modules/.bin/next start",
"dev-nocache": "rm -rf .next && yarn dev",
"dev-cpuprofile-nocache": "rm -rf .next && NEXT_PRIVATE_LOCAL_WEBPACK5=1 node --cpu-prof ../../node_modules/.bin/next",
"build-nocache": "rm -rf .next && yarn build"
}
}
@@ -1,10 +1,10 @@
import { randomBytes } from 'crypto'
import { customAlphabet } from 'next/dist/compiled/nanoid/index.cjs'
import { SpanId } from './shared'
import { reporter } from './report'

const NUM_OF_MICROSEC_IN_SEC = BigInt('1000')

const getId = () => randomBytes(8).toString('hex')
const nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8)
const getId = () => Buffer.from(nanoid(), 'utf8').toString('hex')

// eslint typescript has a bug with TS enums
/* eslint-disable no-shadow */

0 comments on commit 3375e66

Please sign in to comment.