4 ms·
It also is a way for Dart to optimize over JS at the VM level.
by Bahamut 11y ago
It also is a way for Dart to optimize over JS at the VM level.
- espadrine 11y agoNot really. Counter-intuitively, all annotated types are thrown out at runtime, as far as I recall. The VM learns about types in the same way that JS VMs do. Dart's performance wins over JS are elsewhere (object construction and access (designed without prototypes to avoid the performance pitfalls of V8's hidden classes), lack of global object, with and eval…). > The VM designers say that in practice, type guarantees really don’t help them nearly as much as you might think, because type checks are not a major drain on performance. https://www.dartlang.org/articles/why-dart-types/#why-do-type-annotations-have-no-effect-at-runtime https://www.dartlang.org/articles/why-dart-types/#why-do-typ...