Ceviz automatically scans your codebase and detects performance issues that slow down your application:
undefinedLightning-fast performance analyzer for all npm packagesundefined

π° Ceviz automatically scans your codebase and detects performance issues that slow down your application:
# Run without installing
npx ceviz analyze
# Or install globally
pnpm add -g ceviz
# Or add to your project
pnpm add -D ceviz
Real-time performance linting in your editor:
pnpm add -D eslint-plugin-ceviz
// eslint.config.js
import ceviz from 'eslint-plugin-ceviz'
export default [ceviz.configs.recommended]
See eslint-plugin-ceviz for details.
# Analyze current directory
ceviz analyze
# Analyze specific path
ceviz analyze ./my-project
# Output as JSON
ceviz analyze --json
# Save JSON to file
ceviz analyze --json report.json
# Generate interactive HTML report (auto-opens in browser)
ceviz analyze --html
ceviz analyze --html report.html
# Use custom config file
ceviz analyze --config ceviz.config.ts
Create ceviz.config.ts in your project root for full TypeScript autocomplete and type checking:
import { defineConfig } from 'ceviz'
export default defineConfig({
// Load custom plugins
plugins: [
'ceviz-plugin-vue',
'./my-custom-plugin.js'
],
// Configure rules
rules: {
'nested-loops': 'error',
'no-console-log': 'off'
},
// Output reporters
reporters: ['console', 'html'],
// Framework analysis
scanDeps: false,
targetDeps: ['nuxt', 'vite']
})
undefinedBenefits of defineConfig:undefined
Ceviz can also analyze framework code in node_modules to help you report performance issues to maintainers:
# Analyze any framework in your node_modules
ceviz analyze . --scan-deps --target-deps nuxt,vite,vue
For detailed framework analysis instructions, see FRAMEWORK_ANALYSIS.md.
β‘ Ceviz Performance Analysis
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Summary
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Files analyzed: 147
Total issues: 12
β Critical: 5
β Warnings: 7
β Info: 0
Performance score: 72/100 π
Analysis time: 1234ms
π΄ Critical Issues
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β‘ CRITICAL: Nested loop detected (O(nΒ²) complexity)
server/api/users.ts:42
Impact: 100ms β 10s for 1000 items
Complexity: O(nΒ²)
β Use Map/Set for O(1) lookups instead of nested loops
β‘ CRITICAL: Array.find() inside loop creates O(n*m) complexity
composables/useData.ts:78
Impact: 10ms β 5s for 1000x1000 items
β Convert array to Map/Set before the loop for O(1) lookups
πΎ CRITICAL: setInterval without cleanup causes memory leak
components/LiveData.vue:156
Impact: Memory grows indefinitely
β Clear interval in onUnmounted lifecycle
π‘ CRITICAL: readFileSync() blocks the event loop
server/api/config.ts:12
Impact: 50-200ms block per call
β Use async version: readFile()
π Performance Metrics
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
CPU
Worst complexity: O(nΒ²)
Hotspots: 5 locations
Memory
Est. baseline: 450MB
Memory leaks: 2
Bloat level: medium
Bundle
Current size: 1.2MB
Potential savings: 458KB
Heavy deps: moment, lodash
I/O
Blocking ops: 1
Waterfalls: 3
π‘ Quick wins:
1. Fix critical O(nΒ²) loops β use Map/Set for lookups
2. Replace sync file operations β use async versions
3. Clean up memory leaks β add proper cleanup
// β BAD - O(nΒ²)
users.forEach((user) => {
posts.forEach((post) => {
if (post.userId === user.id) {
// ...
}
})
})
// β
GOOD - O(n)
const postsByUser = new Map()
for (const post of posts) {
if (!postsByUser.has(post.userId)) {
postsByUser.set(post.userId, [])
}
postsByUser.get(post.userId).push(post)
}
// β BAD - O(n*m)
items.filter((item) => {
const category = categories.find(cat => cat.id === item.categoryId)
return category?.active
})
// β
GOOD - O(n)
const categoryMap = new Map(categories.map(c => [c.id, c]))
items.filter(item => categoryMap.get(item.categoryId)?.active)
// β BAD - Memory leak
const interval = setInterval(() => {
fetchData()
}, 1000)
// β
GOOD - Cleaned up
const interval = setInterval(() => {
fetchData()
}, 1000)
onUnmounted(() => {
clearInterval(interval)
})
// β BAD - Blocks event loop
const data = fs.readFileSync('file.txt', 'utf-8')
// β
GOOD - Non-blocking
const data = await fs.promises.readFile('file.txt', 'utf-8')
// β BAD - Waterfall (3x slower)
const user = await fetchUser()
const posts = await fetchPosts()
const comments = await fetchComments()
// β
GOOD - Parallel
const [user, posts, comments] = await Promise.all([
fetchUser(),
fetchPosts(),
fetchComments()
])
Ceviz currently has 5 core rules:
| Rule | Category | Severity | Description |
|---|---|---|---|
nested-loops |
CPU | Critical | Detects O(nΒ²) or worse nested loops |
array-find-in-loop |
CPU | Critical | Detects O(n*m) array operations in loops |
memory-leak-interval |
Memory | Critical | Detects unclosed intervals/timeouts |
sync-file-operations |
I/O | Critical | Detects blocking file operations |
sequential-requests |
I/O | Warning | Detects parallelizable async operations |
More rules coming soon!
Ceviz supports a powerful plugin system for creating custom rules and reporters.
// ceviz-plugins/my-plugin.ts
import type { CevizPlugin, Rule } from 'ceviz'
const myRule: Rule = {
id: 'no-console-log',
name: 'No Console Log',
category: 'framework',
severity: 'warning',
description: 'Detects console.log in production code',
enabled: true,
check: (context) => {
// Your analysis logic
return []
},
}
const myPlugin: CevizPlugin = {
name: 'my-custom-plugin',
version: '1.0.0',
rules: [myRule],
setup: async (context) => {
// Listen to hooks
context.hooks.hook('analysis:start', () => {
console.log('Starting analysis...')
})
},
}
export default myPlugin
// ceviz.config.ts
import { defineConfig } from 'ceviz'
import myPlugin from './ceviz-plugins/my-plugin.js'
export default defineConfig({
plugins: [
myPlugin,
'ceviz-plugin-vue', // Or from npm
],
})
See PLUGIN_API.md for complete plugin documentation.
Ceviz exits with code 1 if critical issues are found, making it perfect for CI/CD:
# GitHub Actions
name: Performance Check
on: [pull_request]
jobs:
ceviz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- run: pnpm dlx ceviz analyze
Ceviz can analyze any npm package and detect performance issues:
Run ceviz analyze --html to generate an interactive HTML report with detailed findings.
undefinedWeβre building something special here, and we want YOU to be part of it!undefined
Ceviz is more than just a tool - itβs a movement to make performance analysis accessible, accurate, and actionable for everyone. Weβre 100% open to contributions and wildly open to new ideas.
We want to take Ceviz far beyond what it is today. Our goal is to build the most comprehensive, accurate, and delightful performance analysis tool in the JavaScript ecosystem - analyzing everything from the smallest edge case to framework-level performance issues.
Whether youβre:
undefinedEvery contribution matters! Weβre completely open to:
We review PRs quickly and are happy to mentor new contributors!
Ceviz is just getting started. With your help, we can make it the go-to tool for performance analysis across the entire JavaScript ecosystem. Letβs build something amazing together!
undefinedJoin us: GitHub Issues
MIT Β© Ceviz Team
undefinedBuilt with β€οΈ for all npm packagesundefined
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.