Relevance of @MirrorsUsed, Smoke annotation when using reflection in Dartium

47 Views Asked by At

I have fairly significant application written with Dart and Polymer which uses reflection in a factory method and runs fairly well in Dartium. The factory generates subclass instances using the subclass name passed to it as a parameter.

I'm fine with never generating Javascript and forcing my users, if any, to use Dartium. I'm also fine with modifying any @MirrorsUsed annotations when the list of instantiable subclasses changes. The page at http://dovdev.com/smoke-and-mirrors/ seems to imply that performance and/or codesize can be greatly improved, even in Dartium, by the use of Smoke.

How much does Dartium, or the Dart analyzer, do when running a Dart app? Will Smoke, or even just @MirrorsUsed annotations, do anything for an app in Dartium?

1

There are 1 best solutions below

1
Günter Zöchbauer On

This sounds like you want to use Dartium in production which is definitely a bad idea.

Currently dev_compiler, a fast incremental Dart-2-JS compiler is work in progress to allow to use Chrome as development browser and to make Dartium redundant and discontinue it eventually.

In Dartium @MirrorsUsed() and Smoke don't matter.

If you are using an in-house application where you even consider using Dartium for production, perhaps the code-size effect of using mirrors might not even matter too much.