-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_cursor_performance.ps1
More file actions
102 lines (91 loc) · 3.51 KB
/
check_cursor_performance.ps1
File metadata and controls
102 lines (91 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Cursor Performance Diagnostic Script
Write-Host "`n=== CURSOR PERFORMANCE DIAGNOSTICS ===`n" -ForegroundColor Cyan
# 1. Memory Usage
Write-Host "1. MEMORY USAGE BY PROCESS:" -ForegroundColor Green
$cursorProcesses = Get-Process | Where-Object {$_.ProcessName -like "*Cursor*"}
$totalMemory = 0
foreach ($proc in $cursorProcesses) {
$memMB = [math]::Round($proc.WorkingSet64/1MB, 0)
$totalMemory += $memMB
Write-Host " PID $($proc.Id): $memMB MB" -NoNewline
if ($memMB -gt 500) {
Write-Host " ⚠️ HIGH" -ForegroundColor Red
} elseif ($memMB -gt 200) {
Write-Host " ⚠️ ELEVATED" -ForegroundColor Yellow
} else {
Write-Host " ✓" -ForegroundColor Green
}
}
Write-Host "`n TOTAL: $totalMemory MB`n" -ForegroundColor Cyan
# 2. Node.js Memory Limit
Write-Host "2. NODE.JS MEMORY CONFIGURATION:" -ForegroundColor Green
$nodeOptions = $env:NODE_OPTIONS
if ($nodeOptions) {
Write-Host " Current: $nodeOptions" -ForegroundColor Yellow
} else {
Write-Host " Current: Not set (default ~1400 MB per process)" -ForegroundColor White
}
Write-Host ""
# 3. Extension Count
Write-Host "3. INSTALLED EXTENSIONS:" -ForegroundColor Green
$extPath = "$env:USERPROFILE\.cursor\extensions"
if (Test-Path $extPath) {
$extensions = Get-ChildItem $extPath -Directory
Write-Host " Total: $($extensions.Count) extensions" -ForegroundColor White
# Check for duplicates
$extNames = @{}
foreach ($ext in $extensions) {
$baseName = $ext.Name -replace '-\d+\.\d+\.\d+.*$', ''
if ($extNames.ContainsKey($baseName)) {
$extNames[$baseName] += 1
} else {
$extNames[$baseName] = 1
}
}
$duplicates = $extNames.GetEnumerator() | Where-Object {$_.Value -gt 1}
if ($duplicates) {
Write-Host "`n ⚠️ DUPLICATES FOUND:" -ForegroundColor Red
foreach ($dup in $duplicates) {
Write-Host " - $($dup.Key): $($dup.Value) versions installed" -ForegroundColor Yellow
}
}
} else {
Write-Host " Extension directory not found" -ForegroundColor Red
}
Write-Host ""
# 4. Cache Size
Write-Host "4. CACHE DIRECTORY SIZES:" -ForegroundColor Green
$cacheLocations = @(
"$env:APPDATA\Cursor\Cache",
"$env:APPDATA\Cursor\CachedData",
"$env:APPDATA\Cursor\logs",
"$env:LOCALAPPDATA\Cursor\Cache"
)
foreach ($cachePath in $cacheLocations) {
if (Test-Path $cachePath) {
$size = (Get-ChildItem $cachePath -Recurse -File -ErrorAction SilentlyContinue |
Measure-Object -Property Length -Sum).Sum
$sizeMB = [math]::Round($size/1MB, 0)
Write-Host " $cachePath"
Write-Host " Size: $sizeMB MB" -NoNewline
if ($sizeMB -gt 500) {
Write-Host " ⚠️ LARGE - Consider clearing" -ForegroundColor Yellow
} else {
Write-Host " ✓" -ForegroundColor Green
}
}
}
Write-Host ""
# 5. Recommendations
Write-Host "5. RECOMMENDATIONS:" -ForegroundColor Green
if ($totalMemory -gt 2000) {
Write-Host " ⚠️ High total memory usage ($totalMemory MB) - Consider restarting Cursor" -ForegroundColor Yellow
}
if ($duplicates) {
Write-Host " ⚠️ Remove duplicate extension versions" -ForegroundColor Yellow
}
$largeProcesses = $cursorProcesses | Where-Object {$_.WorkingSet64/1MB -gt 500}
if ($largeProcesses) {
Write-Host " ⚠️ Some processes using >500MB - Check Process Explorer (Help > Open Process Explorer)" -ForegroundColor Yellow
}
Write-Host "`n=== END DIAGNOSTICS ===`n" -ForegroundColor Cyan