This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(bracket): Optimize calling methods on objects.
Optimize the closures used for calling methods on objects by getting rid of an intermediate "field access" that loads the function from the object. This allows us to use InstanceMirror.invoke more directly. Performance =========== The performance implications of this change look good. On the native Dart VM, calling methods through the reflective path becomes 4.5x faster. When compiled to JavaScript, the difference is even bigger and it is 6.7x faster. Dart VM: new: o.f() => g: 18,885,385.384 ops/sec r: 2,252,149.057 ops/sec h: 2,233,514.96 ops/sec i: 32,662,458.941 ops/sec old: o.f() => g: 18,118,349.692 ops/sec r: 496,119.238 ops/sec h: 6,234,893.68 ops/sec i: 31,472,943.499 ops/sec Dart2js: new: o.f() => g: 2,618,328.337 ops/sec r: 1,234,723.632 ops/sec h: 1,234,745.10 ops/sec i: 7,507,441.131 ops/sec old: o.f() => g: 2,427,133.253 ops/sec r: 184,727.903 ops/sec h: 500,226.70 ops/sec i: 7,461,638.467 ops/sec Conflicts: lib/core/parser/backend.dart
- Loading branch information