prettier-plugin-svelte icon indicating copy to clipboard operation
prettier-plugin-svelte copied to clipboard

Saving with sublime and this plugin is extremely slow

Open raurir opened this issue 3 years ago • 5 comments

As demonstrated here: https://github.com/raurir/svelte-code-linting#autoformatting

Similar if not identical to #60

raurir avatar Jun 22 '22 00:06 raurir

Is it also slow with prettier formatting large JS/TS files?

dummdidumm avatar Jun 22 '22 04:06 dummdidumm

@dummdidumm No, it's almost instant, for example this file formats in <0.3 seconds.

raurir avatar Jun 24 '22 02:06 raurir

This is how long formatting takes for me for my codebase of 207 files. Svelte files are 10x slower than Typescript. prettier --check is only 10% faster than prettier --write.

Type File count Time Time per file
.css 2 480 240
.html 1 79 79
.js 2 36 18
.json 2 19 9.5
.svelte 114 41233 361.69
.ts 86 3324 38.65
Total 207 45171  

probablykasper avatar Apr 21 '23 04:04 probablykasper

What's the average character count of your file types? If your Svelte files are 10x as big as your TS files the difference wouldn't surprise me.

dummdidumm avatar Apr 21 '23 12:04 dummdidumm

.ts: 1610 .svelte: 2646 (1.6x)

probablykasper avatar Apr 21 '23 14:04 probablykasper