dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.3k stars 1.59k forks source link

`flutter_style_todos` takes expensive time during checks #58900

Open AlexV525 opened 2 years ago

AlexV525 commented 2 years ago

Describe the issue After dart-lang/linter#3618, flutter_style_todos will cost more time during checks. As discussed in https://github.com/dart-lang/linter/pull/3618#issuecomment-1231899870.

Expected behavior Rewrite the lint rule to not use a regular expression, or improve the performance when checking with regular expressions.

cc @pq

pq commented 2 years ago

@lrhn added some great analysis in https://github.com/dart-lang/linter/pull/3782#issuecomment-1287755497. 👍

AlexV525 commented 2 years ago

What will be our goal for improvements? I saw the time was reduced by ~3x.

pq commented 2 years ago

Right. It's possible that this won't have as big an impact but is worth experimenting with. (It'd be interesting to explore some tests that trigger the quadratic backtracking @lrhn mentioned.) I wouldn't say this is a P1 but just something to keep in the queue. (If nothing else, it might help speedup, however modestly, the flutter bots...)