Alexandre Ardhuin
2015-08-28 21:02:52 UTC
Hi all,
Suppose you have a class that can be used with a const constructor:
class A {
const A();
}
From a performance point of view I expected that using `const A()` was way
better than using `new A()` . However in a quick benchmark on DartVM-1.11.3
there's almost no difference.
1. Is it better to use `const` when possible?
2. What's the use-case where you do want to use `new` instead of `const`
(when `const` can be used)?
3. Should we see better performances with `const` ?
Cheers,
Alexandre
Suppose you have a class that can be used with a const constructor:
class A {
const A();
}
From a performance point of view I expected that using `const A()` was way
better than using `new A()` . However in a quick benchmark on DartVM-1.11.3
there's almost no difference.
1. Is it better to use `const` when possible?
2. What's the use-case where you do want to use `new` instead of `const`
(when `const` can be used)?
3. Should we see better performances with `const` ?
Cheers,
Alexandre
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.