Closed quisquous closed 2 years ago
Found it stuck in coinach.writeTypeScript
, the line that calls ESLint to lint the text, would seem never return, when I am debugging, even killed itself on this step.
Don't know why but seems not the issue on the gen_effect_id.ts
.
$ TIMING=1 eslint ./resources/effect_id.ts --fix
Rule | Time (ms) | Relative
:---------------------------------------|-------------:|--------:
dprint/dprint | 16982641.473 | 100.0%
@typescript-eslint/no-unsafe-assignment | 134.481 | 0.0%
quotes | 47.584 | 0.0%
key-spacing | 34.504 | 0.0%
linebreak-style | 17.298 | 0.0%
@typescript-eslint/no-unused-vars | 15.091 | 0.0%
comma-style | 14.894 | 0.0%
max-len | 14.006 | 0.0%
no-empty-character-class | 4.958 | 0.0%
comma-spacing | 4.756 | 0.0%
Do a benchmark with the un-linted text, and as expected, the dprint cost a lot.
By the way.......
$ time dprint fmt resources/effect_id.ts
Formatted 1 file.
real 0m0.290s
user 0m0.143s
sys 0m0.154s
So there must be something wrong with eslint-plugin-dprint.
This is in line with my experience with dprint. I think it's got some O(n^2) behavior where really long lists of items get progressively worse. See the comments on https://github.com/quisquous/cactbot/pull/3212#issue-931235051 about "CombatantJobSearch took 20 minutes to format". Agreed that dprint is fast, but it's dprint combined with our eslint rules that is slow.
We could attempt to format it ourselves in a way that we know will satisfy lint, and I think that would then make linting fast. Or, we could disable lint on that file? Do you have any thoughts?
As Trim is working https://github.com/quisquous/cactbot/pull/3677 , I think we can wait for this PR done ('cause we need a dprint.json config file for dprint itself), and then manually invoke dprint formatted before ESLint, which should fix the problem?
This seems to be fixed now.
Just noting this as something that seems wrong. If I run it, it prints all the collisions, ending with
collision DeepFreeze
and then stalls for many minutes. I'm not sure what is wrong.If I run the old deleted python version, there's no changes. So, this isn't urgent yet.