source_span
source_span copied to clipboard
SourceFile sets up _lineStarts eagerly
trafficstars
The body of the SourceFile.decoded could be executed lazily. It would increase the performance for cases when serialisation of spans is not necessary. For example, doing successful AST transformations without needing to report errors.
https://github.com/dart-lang/source_span/blob/f9343087ba37f0cb089648b75fc30d99d2eb2c26/lib/src/file.dart#L73-L85