re-ovo / unocss-intellij

Unocss support on Intellij Idea/WebStorm
https://plugins.jetbrains.com/plugin/22204-unocss
MIT License
173 stars 12 forks source link

CPU to the moon #60

Closed DeniroBlack closed 7 months ago

DeniroBlack commented 8 months ago

Hi, when i using plugin unocss, my cpu is hight to max

image

image

Without unocss plugin

image

image

Windows 11

image

Выпуск Windows 11 Pro Версия 22H2 Дата установки ‎14.‎04.‎2023 Сборка ОС 22621.2283 Взаимодействие Windows Feature Experience Pack 1000.22662.1000.0

PHPSTORM:

image

PhpStorm 2023.3.2 Build #PS-233.13135.108, built on December 21, 2023 Licensed to Den Black You have a perpetual fallback license for this version. Subscription is active until February 6, 2025. Runtime version: 17.0.9+7-b1087.9 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 GC: G1 Young Generation, G1 Old Generation Memory: 10240M Cores: 16 Registry: debugger.watches.in.variables=false debugger.new.tool.window.layout=true run.processes.with.pty=TRUE ide.experimental.ui=true Non-Bundled Plugins: com.codeium.intellij (1.6.34) com.webfont.ideaplugin (3.0) com.github.wjlroe.idea-json-detect (1.3) net.seesharpsoft.intellij.plugins.csv (3.3.0-233) com.jetbrains.plugins.jade (233.11799.172)

mshamaseen commented 7 months ago

@re-ovo, we would appreciate it if you could have a look at this, as the plugin is unusable currently because of this issue.

re-ovo commented 7 months ago

@mshamaseen Please provide cpu profiler report (intellij diagnostic tool)

The snapshot will be saved to the user home directory. Please, share this snapshot with us

mshamaseen commented 7 months ago

@re-ovo I tried to reproduce the issue on multiple devices and multiple projects, 2 with filesystem option points to *.blade files, and one with VueJs; they all result to high CPU usage. Here is the diagnostic, this is a Laravel + blade + unocss project, uno config:

export default defineConfig({
    content: {
        filesystem: [
            'resources/forms/**/index.blade.php',
            'resources/forms/layout.blade.php',
        ]
    }
})

PS-233.14808.18_shamaseen_13.03.2024_18.02.06.zip

re-ovo commented 7 months ago

@mshamaseen It seems that this is a performance problem caused by initialization. Can you provide a minimum reproducible project? Because I can't reproduce it in my own project. Thanks

Also, what's your package manager system? yarn?

mshamaseen commented 7 months ago

@re-ovo I've sent you an invitation to our private project; it is a new project and currently is just a landing page; feel free to inspect it.

re-ovo commented 7 months ago

@re-ovo I've sent you an invitation to our private project; it is a new project and currently is just a landing page; feel free to inspect it.

Tested and it still works fine on my computer

  1. What version of NodeJS are you using? What package management tool are you using?
  2. When the CPU is too high, under what circumstances does it happen? Just start? Or typing?
  3. Is "Updating Uncoss Config" displayed in the lower right corner of the editor when lagging?
mshamaseen commented 7 months ago

You need to open any .blade file under resources/views/** See the following screencast that illustrate how the CPU goes up, and then it goes down when I disable uno plugin https://github.com/re-ovo/unocss-intellij/assets/38951661/9c924999-b037-4598-894f-d8699f7fa894

mshamaseen commented 7 months ago

Just a note, I don't have Nodejs nor NPM installed on my device, I use docker to run my projects, so at the time of recording there is no npm or NodeJS activated

mshamaseen commented 7 months ago

Ok it seems the issue is about NodeJS, I just ran a NodeJS docker and connected it with PHPstorm and everything is good. Maybe somekind of error message if Unocss didn't find a connected NodeJs would solve the issue? Thank you for your time!