Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
perf(ChangeDetector): create _EvalWatchRecord#namedArgs lazily
Browse files Browse the repository at this point in the history
This change reduces the number of Maps in the heap on binding heavy views by 30%.
  • Loading branch information
IgorMinar committed Jun 12, 2014
1 parent 11629de commit 42e53b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/change_detection/watch_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ class _NamedArgHandler extends _ArgHandler {
super(watchGrp, 'namedArg[$name]', record);

void acceptValue(object) {
if (watchRecord.namedArgs == null) {
watchRecord.namedArgs = new Map<Symbol, dynamic>();
}
watchRecord.dirtyArgs = true;
watchRecord.namedArgs[name] = object;
}
Expand Down Expand Up @@ -728,7 +731,7 @@ class _EvalWatchRecord implements WatchRecord<_Handler> {
WatchGroup watchGrp;
final _Handler handler;
final List args;
final Map<Symbol, dynamic> namedArgs = new Map<Symbol, dynamic>();
Map<Symbol, dynamic> namedArgs = null;
final String name;
int mode;
Function fn;
Expand Down

0 comments on commit 42e53b8

Please sign in to comment.