neoformat icon indicating copy to clipboard operation
neoformat copied to clipboard

Extremely slow when using Black on large files

Open Hubro opened this issue 2 years ago • 4 comments

Using Black on a large Python file with Neoformat is extremely slow.

If the contents of the file doesn't require reformatting, :Neoformat black returns "no change necessary" in 3-400 ms, just like black in the command line. However, if I add an extra empty line so the file has to be reformatted, running the same command takes 3-4 full seconds. This is a massive pain to wait for every time I save the file.

Using the official Black plugin instead, reformatting takes pretty much exactly as long as it does when running Black through the command line, i.e. 3-400 ms.

Hubro avatar Aug 12 '22 22:08 Hubro

Same here

YuCao16 avatar Nov 08 '22 14:11 YuCao16

Something similar is happening also with prettier.

alecandido avatar Jan 11 '23 07:01 alecandido

Same here

long2ice avatar Mar 14 '23 09:03 long2ice

still very slow

nicolasaunai avatar Jul 04 '23 09:07 nicolasaunai