INNER CODE UNIT · TypeScript
logPerfSummary
onejs/one · packages/compiler/src/index.ts:49
function logPerfSummary() {
// Only log detailed perf stats when debugging
if (!process.env.DEBUG_COMPILER_PERF) {
return
}
console.info('\n📊 [Compiler Performance Summary]')
console.info(
`Babel: ${perfStats.babel.totalTransforms} transforms / ${perfStats.babel.totalCalls} calls (${((perfStats.babel.totalTransforms / Math.max(perfStats.babel.totalCalls, 1)) * 100).toFixed(1)}% transform rate)`
)
console.info(`Babel total time: ${perfStats.babel.totalTime}ms`)
for (const [env, stats] of Object.entries(perfStats.babel.byEnvironment)) {
if (stats.transforms > 0) {
console.info(
` ${env}: ${stats.transforms} transforms, ${stats.time}ms (${(stats.time / stats.transforms).toFixed(1)}ms avg)`
)
}