As part of starting an isolate we run bootstrapping code. Part of that will use the Uri class which triggers lazy creation of Uri scanning tables, see sdk/lib/core/uri.dart:
final List<Uint8List> _scannerTables = _createTables();
List<Uint8List> _createTables() {
// TODO(lrn): Use a precomputed table.
... lots of logic here ...
}
=> This is not good for startup latency in general.
=> It is a base cost for any Isolate.spawn(). Making it less appealing to use isolates for short-lived tasks.
The tables can be pre-computed and baked in as a constant into the core libraries, addressing the existing todo in the code.
/cc @lrhn