-
Notifications
You must be signed in to change notification settings - Fork 248
feat(Scope): Instrument Scope to use User tags in Dart Obervatory #1138
Conversation
@@ -667,6 +667,8 @@ class RootScope extends Scope { | |||
* [ScopeDigestTTL]. | |||
*/ | |||
void digest() { | |||
var digestTag = new UserTag('Digest'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you reuse a static/final tag instead of creating a new one each time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to @vicb's comment
@jbdeboer related to #1119, wouldn't all user code be run using scope.watch? If this is OK to assume we could expose a public version of scope.watch() which would set the correct tags when using. Internally we could use different scope.watch method which would set the correct flags for internal usage. Something like:
Not sure if this is the right approach.. I'm still thinking this through... Any suggestions are welcome :) |
final UserTag _runAsyncTag = new UserTag('RunAsync'); | ||
final UserTag _domReadTag = new UserTag('DomRead'); | ||
final UserTag _domWriteTag = new UserTag('DomWrite'); | ||
UserTag _previousTag; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved locally to the functions
Btw, it's an interesting insight that reaction function during digest is by far the most expensive in this example. |
AvgStopwatch processStopwatch, | ||
String state, | ||
num sequenceNumber}) { | ||
UserTag detectChangesTag = new UserTag('DetectChanges / $state${sequenceNumber != null ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UserTags need to be stored in global variable. We can't be making new ones ever time this code runs.
Nice work. Just make sure that we don't constantly create new tags. |
LGTM, Otherwise |
@@ -367,6 +368,8 @@ class WatchGroup implements _EvalWatchList, _WatchGroupList { | |||
class RootWatchGroup extends WatchGroup { | |||
final FieldGetterFactory _fieldGetterFactory; | |||
Watch _dirtyWatchHead, _dirtyWatchTail; | |||
Map<String, UserTag> _detectChangesTags = new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use List instead of Map. Initialize List size from ScopeTTL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Also instrument View creation. This can be done in ViewFactory |
@markovuksanovic @tbosch How do we know this change doesn't cause a performance regression in production mode (when tags are not needed?) |
@jbdeboer I guess the only way to answer your question is to run some benchmarks. Do you know if there are some benchmarks that are already in place which could be used for this? I've seen some benchmarks added recently. |
The tests I have run do not show any impact on performance. Changing tags On Tue, Jun 24, 2014 at 6:59 AM, Marko Vuksanovic [email protected]
|
No description provided.