Repository navigation
Conversation
| super(); | ||
| } finally { | ||
| window.performance.mark(endMark); | ||
| window.performance.measure(measure, startMark, endMark); |
There was a problem hiding this comment.
If it's straightforward, it'd be a touch better to do the measure() outside of the critical path. Eg done in rIC
There was a problem hiding this comment.
no clear way to ensure that it gets called before the timeline is closed when doing that asynchronously
|
Just FWIW, I benchmarked the cost of |
|
Do you have any info on the cost of calling measure()? The nondeterminism of rIC makes me nervous. AIUI it's entirely possible that the user will end timeline recording before a single idle callback fires. I guess we could give it a timeout of not too long. |
046e427 to
881fdb2
Compare
I tried it out and it's fine. measure() is like 30% more expensive than mark(), but we're still talking sub-microsecond for each. |
| /bower_components/ | ||
| /node_modules/ | ||
| /build/ | ||
| /src/document-context/*.js* No newline at end of file |
There was a problem hiding this comment.
could we move to a src/lib split?
There was a problem hiding this comment.
We're currently compiling a single file, seems like overkill at this point IMO
| { | ||
| "name": "Polymer DevTools Extension", | ||
| "version": "0.0.5", | ||
| "version": "0.0.6", |
There was a problem hiding this comment.
looks like I already 0.0.6 on the chrome store
|
|
||
| var pagePorts = new Map(); | ||
| var polymerPanelPorts = new Map(); | ||
| const pagePorts = new Map(); |
| } else if ( | ||
| messageType === 'get-element-stats' || | ||
| messageType === 'clear-element-stats') { | ||
| console.log('messageType', messageType); |
There was a problem hiding this comment.
removed, here and elsewhere
| }); | ||
|
|
||
| } else if (port.name =='element-zones') { | ||
| } else if (port.name == 'element-zones') { |
There was a problem hiding this comment.
remove if not needed, or rename, since element-zones isn't used anymore?
| let elementCounter = 0; | ||
| const originalCreate = proto.createdCallback || (() => undefined); | ||
|
|
||
| function wrap(name: string, fullName: string) { |
There was a problem hiding this comment.
longer name please :) maybe wrapCallback?
There was a problem hiding this comment.
+1. wrapCustomElementCallback is clear and doesn't cause any line wraps.
| const result = makeMeasurement( | ||
| 'created', tagName, counter, () => originalCreate.apply(this)); | ||
|
|
||
| const originalPropertySetter = this._propertySetter; |
There was a problem hiding this comment.
can you patch this at the prototype level?
There was a problem hiding this comment.
looks like yes! I guess this was an artifact of back when we were doing more patching of the Polymer() call?
| constructor: CustomElementV1Constructor): CustomElementV1Constructor { | ||
| let wrappedConstructor: CustomElementV1Constructor = | ||
| class extends constructor { | ||
| constructor() { |
There was a problem hiding this comment.
might want to do constructor(...args) and super(...args) just in case
| const startMark = `${prefix}start created ${tagName} ${counter}`; | ||
| const endMark = `${prefix}end created ${tagName} ${counter}`; | ||
| const measure = `${prefix}created ${tagName} ${counter}`; | ||
|
|
There was a problem hiding this comment.
you're not wrapping _propertySetter here
| @@ -7,14 +7,12 @@ | |||
| "dev": "gulp dev" | |||
|
Do yall want us to show this at polymer summit? +@samccone |
rictic
left a comment
There was a problem hiding this comment.
All comments addressed, PTAL!
| new (): V1CustomElement; | ||
| } | ||
|
|
||
| interface V1CustomElement extends HTMLElement { |
There was a problem hiding this comment.
I don't think they do. e.g.
document.body.connectedCallback // => undefined|
|
||
| var pagePorts = new Map(); | ||
| var polymerPanelPorts = new Map(); | ||
| const pagePorts = new Map(); |
| } else if ( | ||
| messageType === 'get-element-stats' || | ||
| messageType === 'clear-element-stats') { | ||
| console.log('messageType', messageType); |
There was a problem hiding this comment.
removed, here and elsewhere
| }); | ||
|
|
||
| } else if (port.name =='element-zones') { | ||
| } else if (port.name == 'element-zones') { |
| } | ||
|
|
||
| interface CustomElementsRegistry { | ||
| define(tagName: string, constructor: CustomElementV1Constructor): |
There was a problem hiding this comment.
Yeah, the spec has it as any which is how I'm contributing it up for now:
microsoft/TypeScript-DOM-lib-generator#150
Gonna leave this as is until the next typescript release when we can delete it.
| constructor: CustomElementV1Constructor): CustomElementV1Constructor { | ||
| let wrappedConstructor: CustomElementV1Constructor = | ||
| class extends constructor { | ||
| constructor() { |
| const startMark = `${prefix}start created ${tagName} ${counter}`; | ||
| const endMark = `${prefix}end created ${tagName} ${counter}`; | ||
| const measure = `${prefix}created ${tagName} ${counter}`; | ||
|
|
| const result = makeMeasurement( | ||
| 'created', tagName, counter, () => originalCreate.apply(this)); | ||
|
|
||
| const originalPropertySetter = this._propertySetter; |
There was a problem hiding this comment.
looks like yes! I guess this was an artifact of back when we were doing more patching of the Polymer() call?
| @@ -7,14 +7,12 @@ | |||
| "dev": "gulp dev" | |||
| { | ||
| "name": "Polymer DevTools Extension", | ||
| "version": "0.0.5", | ||
| "version": "0.0.6", |
|
@paulirish Here's a screenshot! |
Adds:
* easy visualization of performance impact of custom elements
inline with other performance information in browser timeline
devtools
* support for Custom Elements v0
Removes:
* 'Polymer' panel in devtools.
* The data model changed significantly so that code will need
to be rewritten significantly.
* ... and I kind don't believe in the feature that much.
Being able to visualize the impact in the timeline seems
superior to aggregate statistics.
* Async tracking with zones.
* I'd like to add this back. The zones API has changed completely,
and it uses a decent amount of idiosyncratic terminology without
defining any of it. Yay. Just needs some sweat, and this is useful
as is.
|
Ok, got tests passing. Sorry about that. PTAL |

Adds:
inline with other performance information in browser timeline
devtools
Removes:
to be rewritten significantly.
Being able to visualize the impact in the timeline seems
superior to aggregate statistics.
and it uses a decent amount of idiosyncratic terminology without
defining any of it. Yay. Just needs some sweat, and this is useful
as is.