elicwhite / ESLint-Formatter

Sublime Text 3 Plugin to Autoformat with Eslint
MIT License
140 stars 20 forks source link

Performance #82

Closed switz closed 4 years ago

switz commented 4 years ago

I'm seeing performance problems on somewhat large files, ~2000 lines. Not small by any stretch, but I feel like it's slower than it should be. Blocking sublime for ~4-5 seconds on each save and sometimes crashing.

I'm using eslint_d (and prettier in my eslint config) if that helps.

on post save:

    ESLint-Formatter.ESLint-Formatter: 10.027s total, mean: 2.507s, max: 5.311s

Obviously 2,000 lines is not normal and I can break this file up, but was just wondering if anyone has any advice for reducing the runtime.

skeggse commented 4 years ago

Are you seeing that eslint_d takes that long from a shell, too?

switz commented 4 years ago

Well stupid me -- I tested it before I posted this, thinking I was all clever, and it was only taking ~500ms.

But I forgot to run it with the --fix flag, which then bumped it up from 500ms to 3-5 seconds.

So this is purely blocked by the eslint_d command, and I suppose is out of the scope of this plugin. Apologies for taking up your time and thank you for a great library!

katerlouis commented 3 years ago

I'm wondering why VSCode does formatting on save instantly, while SublimeText takes roughly 2 seconds to do it. And it often messes up my scroll by scrolling to the top of the page.

This is literally the only thing that makes me flirt with VSCode :(

How does VSCode do it? Is it possible to get ST3 just as fast?

sonickseven commented 3 years ago

I'm wondering why VSCode does formatting on save instantly, while SublimeText takes roughly 2 seconds to do it. And it often messes up my scroll by scrolling to the top of the page.

This is literally the only thing that makes me flirt with VSCode :(

How does VSCode do it? Is it possible to get ST3 just as fast?

The only way to that performance works some fast like VScode is with Prettier, i tried using Eslinter-Formatted but is slow and i had than change to Prettier