diff --git a/.github/workflows/next_swc_benchmark.yml b/.github/workflows/next_swc_benchmark.yml new file mode 100644 index 000000000000..0fe5b5abf66c --- /dev/null +++ b/.github/workflows/next_swc_benchmark.yml @@ -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 diff --git a/packages/next-swc/crates/next-build-test/jsConfig.json b/packages/next-swc/crates/next-build-test/jsConfig.json new file mode 100644 index 000000000000..21c607e74c91 --- /dev/null +++ b/packages/next-swc/crates/next-build-test/jsConfig.json @@ -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" + } +} \ No newline at end of file diff --git a/packages/next-swc/crates/next-build-test/nextConfig.json b/packages/next-swc/crates/next-build-test/nextConfig.json new file mode 100644 index 000000000000..a608c1031217 --- /dev/null +++ b/packages/next-swc/crates/next-build-test/nextConfig.json @@ -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": {} + } \ No newline at end of file