dart-lang / webdev

A CLI for Dart web development.
https://pub.dev/packages/webdev
212 stars 75 forks source link

Gather Dart scripts from the build system and not through Chrome #907

Open grouma opened 4 years ago

grouma commented 4 years ago

We collect the available Dart scripts through a number of Chrome evaluations. For significantly large applications, e.g. 20k+ Dart sources, this process is quite slow.

In particular, we collect all of the Dart modules here: https://github.com/dart-lang/webdev/blob/446fb9d63875a765fa3704c71ed76ede61a51325/dwds/lib/src/debugging/inspector.dart#L278

The above evaluation can take upwards of 6 seconds.

We then turn around to get all of the scripts with this evaluation: https://github.com/dart-lang/webdev/blob/446fb9d63875a765fa3704c71ed76ede61a51325/dwds/lib/src/debugging/inspector.dart#L365

The above evaluation can take upwards of two seconds. It's also worth noting that the size of the evaluation string can be insanely large.

Ideally, we should gather the Dart sources directly from the build system which will almost certainly be much much faster.

grouma commented 4 years ago

cc @annagrin