I think these are all related, but I'm happy to split up if desirable.
dartdoc is one of the heavy users of package:html, and we'd like it to be as performant as possible. This change seems to have reduced dartdoc's memory consumption by ~2%, but that could be within the margin of error.
Changes include:
Use growable: false where possible.
Add type annotations to empty Lists, so they're not List<dynamic> (need to enable strict-raw-types).
Flip from implicit-casts: false to strict-casts: true.
Replace List.from with List.of.
Cast dynamic things to List before iterating over them in a for loop.
I think these are all related, but I'm happy to split up if desirable.
dartdoc is one of the heavy users of package:html, and we'd like it to be as performant as possible. This change seems to have reduced dartdoc's memory consumption by ~2%, but that could be within the margin of error.
Changes include:
growable: false
where possible.List<dynamic>
(need to enablestrict-raw-types
).implicit-casts: false
tostrict-casts: true
.List.from
withList.of
.dynamic
things toList
before iterating over them in a for loop.