ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

[WIP] Instrument glimmer components

Open achambers opened this issue 5 years ago • 4 comments

WIP

Initial render

image

Rerender

image

achambers avatar Mar 13 '20 11:03 achambers

@achambers thanks for getting this started!

I think that if we were to start instrumenting components in general, we would probably want to only do so in DEBUG builds, or if the Ember Inspector were installed and open. It's a lot of extra work to do in general for every user.

Beyond that, we've been discussing moving the DebugRenderTree upstream into the Glimmer VM, which would make more sense because it could be more generalized. I had a conversation about this functionality with @krisselden the other day, and he also thought it would make most sense if we required instrumenting to be an opt-in feature, so you manually mark a component before it shows up in the timeline.

This is all just some context, that refactor would be pretty large anyways so it could definitely pull this work along with it if/when it happens 😄 just wanted to let you know what the current thinking is

pzuraq avatar Mar 13 '20 15:03 pzuraq

@achambers thanks for getting this started!

I think that if we were to start instrumenting components in general, we would probably want to only do so in DEBUG builds, or if the Ember Inspector were installed and open. It's a lot of extra work to do in general for every user.

Beyond that, we've been discussing moving the DebugRenderTree upstream into the Glimmer VM, which would make more sense because it could be more generalized. I had a conversation about this functionality with @krisselden the other day, and he also thought it would make most sense if we required instrumenting to be an opt-in feature, so you manually mark a component before it shows up in the timeline.

This is all just some context, that refactor would be pretty large anyways so it could definitely pull this work along with it if/when it happens 😄 just wanted to let you know what the current thinking is

Thanks for taking the time to reply @pzuraq. Makes sense. Also, some extra context that @krisselden provided in Discord also made some very valid points.

So, just for context, we've been doing some serious performance profiling of a page on our Ember app and the ember-perf-timeline addon has been super useful. However, we've needed to convert all of our Glimmer components to Ember components just so that we could profile them. Which is what spurred on the conversation with @rwjblue that lead to me spiking this out.

Would I be correct in summarizing your reply by saying that there are a couple of places that the instrumentation could take place but the correct and most desirable place for it to happen is actually inside the Glimmer VM which is a considerable piece of work. And, reading between the lines, this isn't likely to happen any time soon?

Is there anything we can do to help out with this or help move it forward or is it a deeper issue than that needs solid core team focus and involvement?

And out of interest, what sense of priority does being able to profile Glimmer components have in relation to other things going on?

achambers avatar Mar 23 '20 11:03 achambers

Is this still relevant?

kategengler avatar Dec 12 '23 16:12 kategengler

Is this still relevant?

By the looks of @pzuraq 's repy, this PR is not, but the intent is, as far as I understand. I could be wrong but I'm not aware that instrumentation of Glimmer components was implemented. Not having this meant that Glimmer components don't appear in the rendering tab of the Ember Inspector and can't be measured on the Chrome performance tab.

If this has, indeed, been implemented then this is no longer relevant and my understanding is outdated :)

achambers avatar Jan 23 '24 10:01 achambers