Skip to content

Commit

Permalink
add CI script for benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Apr 18, 2024
1 parent 73c3137 commit 0a47009
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/next_swc_benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: next_swc Benchmark
on:
workflow_dispatch: {}
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
matrix:
pages: [0, 1, 12]
steps:
- uses: actions/checkout
- name: Install heaptrack
run: apt install heaptrack
- name: Build binary
run: cargo build --profile release-with-debug --manifest-path $GITHUB_WORKSPACE/packages/next-swc/crates/next-build-test/Cargo.toml
- name: Run benchmark
run: bash bench.sh 29de71d77fd3db93c33cc3886c64a32ad889278f ${{ matrix.pages }}
- name: Print results
run: tail -n 7 result.log
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: resport
path: result.log
39 changes: 39 additions & 0 deletions packages/next-swc/crates/next-build-test/jsConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": false,
"skipLibCheck": true,
"strict": true,
"lib": [
"lib.dom.d.ts",
"lib.dom.iterable.d.ts",
"lib.esnext.d.ts"
],
"module": 99,
"target": 8,
"moduleResolution": 2,
"incremental": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": 1,
"plugins": [
{
"name": "typescript-plugin-css-modules",
"options": {
"goToDefinition": true
}
},
{
"name": "next"
}
],
"allowJs": true,
"paths": {},
"tsBuildInfoFile": "/tmp/ignore",
"strictNullChecks": true,
"pathsBasePath": "/tmp/ignore"
}
}
196 changes: 196 additions & 0 deletions packages/next-swc/crates/next-build-test/nextConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"env": {},
"webpack": {},
"eslint": {
"ignoreDuringBuilds": false
},
"typescript": {
"ignoreBuildErrors": false,
"tsconfigPath": "tsconfig.json"
},
"distDir": ".next",
"cleanDistDir": true,
"assetPrefix": "",
"cacheMaxMemorySize": 52428800,
"configOrigin": "next.config.mjs",
"useFileSystemPublicRoutes": true,
"generateBuildId": null,
"generateEtags": true,
"pageExtensions": [
"jsx",
"js",
"tsx",
"ts",
"mdx",
"md"
],
"poweredByHeader": true,
"compress": true,
"analyticsId": "",
"images": {
"deviceSizes": [
640,
750,
828,
1080,
1200,
1920,
2048,
3840
],
"imageSizes": [
16,
32,
48,
64,
96,
128,
256,
384
],
"path": "/_next/image",
"loader": "default",
"loaderFile": "",
"domains": [
"vercel.com",
"assets.vercel.com",
"api-frameworks.vercel.sh",
"github.com",
"images.ctfassets.net",
"og-image.vercel.app",
"cdn.cosmicjs.com",
"cdn.raster.app",
"img.youtube.com",
"raw.githubusercontent.com",
"www.datocms-assets.com",
"t3.gstatic.com",
"res.cloudinary.com"
],
"disableStaticImages": false,
"minimumCacheTTL": 60,
"formats": [
"image/avif",
"image/webp"
],
"dangerouslyAllowSVG": false,
"contentSecurityPolicy": "script-src 'none'; frame-src 'none'; sandbox;",
"contentDispositionType": "inline",
"remotePatterns": [
{
"protocol": "https",
"hostname": "dmmcy0pwk6bqi.cloudfront.net"
}
],
"unoptimized": false
},
"devIndicators": {
"buildActivity": true,
"buildActivityPosition": "bottom-right"
},
"onDemandEntries": {
"maxInactiveAge": 60000,
"pagesBufferLength": 5
},
"amp": {
"canonicalBase": ""
},
"basePath": "",
"sassOptions": {},
"trailingSlash": false,
"i18n": null,
"productionBrowserSourceMaps": false,
"optimizeFonts": true,
"excludeDefaultMomentLocales": true,
"serverRuntimeConfig": {},
"publicRuntimeConfig": {},
"reactProductionProfiling": false,
"reactStrictMode": true,
"httpAgentOptions": {
"keepAlive": true
},
"outputFileTracing": true,
"staticPageGenerationTimeout": 60,
"swcMinify": true,
"modularizeImports": {},
"experimental": {
"prerenderEarlyExit": false,
"serverMinification": true,
"serverSourceMaps": false,
"linkNoTouchStart": false,
"caseSensitiveRoutes": false,
"clientRouterFilter": true,
"clientRouterFilterRedirects": false,
"fetchCacheKeyPrefix": "",
"middlewarePrefetch": "flexible",
"optimisticClientCache": true,
"manualClientBasePath": false,
"cpus": 2,
"memoryBasedWorkersCount": false,
"isrFlushToDisk": true,
"workerThreads": false,
"optimizeCss": false,
"nextScriptWorkers": false,
"scrollRestoration": false,
"externalDir": false,
"disableOptimizedLoading": false,
"gzipSize": true,
"craCompat": false,
"esmExternals": true,
"fullySpecified": false,
"outputFileTracingRoot": "/tmp/ignore",
"swcTraceProfiling": false,
"forceSwcTransforms": false,
"largePageDataBytes": 128000,
"adjustFontFallbacks": false,
"adjustFontFallbacksWithSizeAdjust": false,
"turbo": {
"rules": {
"*.mdx": {
"loaders": [
"turbopack-mdx-loader"
],
"as": "*.tsx"
}
},
"resolveAlias": {
"fs": {
"browser": "./turbopack/empty.js"
},
"cookie": {
"browser": "./turbopack/empty.js"
},
"http": {
"browser": "./turbopack/empty.js"
},
"https": {
"browser": "./turbopack/empty.js"
},
"node-fetch": {
"browser": "./turbopack/empty.js"
}
}
},
"typedRoutes": false,
"instrumentationHook": true,
"bundlePagesExternals": false,
"parallelServerCompiles": false,
"parallelServerBuildTraces": false,
"ppr": false,
"missingSuspenseWithCSRBailout": true,
"optimizeServerReact": true,
"useEarlyImport": false,
"serverComponentsExternalPackages": [],
"useLightningcss": true,
"optimizePackageImports": []
},
"configFile": "/tmp/ignore",
"configFileName": "next.config.mjs",
"transpilePackages": [],
"_originalRewrites": {
"beforeFiles": [],
"afterFiles": [],
"fallback": []
},
"_originalRedirects": [],
"exportPathMap": {}
}

0 comments on commit 0a47009

Please sign in to comment.