-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance problems #12
Comments
Hi Zach. In terms of performance, one of the biggest issues is not being able to render a non existent component. If you look at the code base, we are still forced to create and render each invisible component. This means that for each row, we actually render 3 (although 2 of which are just comments, we are still forced to create two additional views). I've spoken to @rwjblue about this and it seems to be a limitation with the component helper not being able to accept null as a component name. In terms of profiling, can you provide a snippet of your table setup so that way we are all profiling the same thing? I'm currently on vacation but I'll be able to look at this early next week. |
{{#netuitive-table-new model=model columns=columns as |ntn|}}
{{#light-table ntn.table tableActions=(hash checkAll=(action 'checkAll')) as |t|}}
{{t.head
onColumnClick=(action ntn.onColumnClick)
iconAscending='fa fa-sort-asc'
iconDescending='fa fa-sort-desc'
}}
{{t.body
canSelect=false}}
{{/light-table}}
{{/netuitive-table-new}}
|
Do you know off the top of your head where in the codebase it creates and renders each invisible component? I've poked through it quite a bit and I'm not sure I've seen that or know exactly what you mean. |
See addon/templates/components/lt-body.hbs |
Ok, I actually extended that component and the EDIT: I made a |
@SirZach makes sense... |
This has been addressed and to my knowledges resolved with #14. Gonna go ahead and close this for now. Feel free to reopen if you face any more performance issues. |
Would limiting how much is rendered address this problem? For example, we could use something like smoke-and-mirrors to render only the rows that the user can see. Would this address the issue with having thousands of rows? |
@taras I think something like smoke-and-mirrors would be great although I do believe that the project is planning on dropping support for tables for the 1.0 release. Regardless, the columns in the attached image are simply too much for rendering even small amounts of data, about 25-50 rows. |
A few things I've learned related to performance with big tables: API:
Ember:
Ideally the Ember things would be used only when running into issues, I don't think that they should be a default. Especially considering most apps don't need to support tables of this size. Maybe we add Generally speaking, I'd try and see if there is a different UI design that allows for a more rolled up view of the data, but sometimes you have no choice. Not sure if any of this helps, but there's a braindump for you. 😄 |
@cball this is great. Thank you! |
Table support will be in smoke-and-mirrors 1.0, but not via the main component, it does have it's own edge cases.
If you look into the virtual-item branch of smoke-and-mirrors, the
These are ED issues more than anything else, I have a p.o.c. that shows for large quantities of data we could be roughly 1000x faster with much lower memory overhead than ED is (includes having relationships, and improves the sparse relationship story). These are changes I'm plotting to help bring to ED itself. I'd be willing to clean up the p.o.c. and release it as something like "ember-light-store" or some such. I would add to this that I've consistently found the biggest bottleneck in long lists / large data sets is not render, but the instantiation cost of |
@runspired that sounds super exciting! Once S&M hits 1.0 we can think of restructuring the internals of this table to support occlusion rendering. One more thing that I want to note, which I believe can be a pretty big cause of the rendering performance problems is not being able to render "null" components. Looking at the tbody of this addon: {{#each rows as |row|}}
{{lt-row row}}
{{yield (hash
expanded-row=(component 'lt-spanned-row' classes='lt-expanded-row' colspan=colspan yield=row visible=row.expanded)
loader=(component 'lt-spanned-row' visible=false)
no-data=(component 'lt-spanned-row' visible=false)
) rows}}
{{/each}}
{{yield (hash
loader=(component 'lt-spanned-row' classes='lt-is-loading' colspan=colspan)
no-data=(component 'lt-spanned-row' classes='lt-no-data' colspan=colspan)
expanded-row=(component 'lt-spanned-row' visible=false)
) rows}} Everytime we yield, we must yield all 3 body contextual components which use As you can see from the above screenshot, For every single rendered row, there are actually 3 components being instantiated and only one being rendered. Currently, there is no way to use the |
I also encountered some of the performance limitations discussed here. One temporary solution I found that yielded significant results was dropping out ember-scrollable and ember-wormhole from the |
Thanks @nmcclay that improved my performance around 25%. Any other tip ? (I didn't find any |
@offirgolan could glimmer 2 improve performance? :D have you tested anything ? |
@offirgolan FYI, I maintain a helper that allow to check whether a component name resolves to an actual component: https://github.com/xcambar/ember-cli-is-component It allows : {{#if (is-component componentName)}}
do what you have to do
{{/if}} It could help you working around the component helper only acccepting valid components names. |
@vasilakisfil @offirgolan in our project relying on [email protected] @travis-jm found substantial rendering increases by updating to ember 2.9.0-beta.4. In some cases a load time of 20 seconds down to 5 when rendering 500 rows. (see #209 for fix needed before trying) |
Interesting ! Could it be new glimmer rendering engine ?
|
@efx thats really great news! I've been so busy, I havent had time to test the latest beta. I'll try to help as much as I can to resolve the issue so we can be 2.9.0 ready 😄 |
@efx v1.4.2 has been released with the updated dependencies. |
Even with glimmer2 you will now get a perf boost movin this to smoke and mirrors |
(I'd offer to help you work it in but I'm also busy on way too many things right now) |
ftr ember-wormhole currently does not work at all with glimmer2. Also ftr, I'm close to having a fix in for it. |
I was able to improve performance up to 50% by removing lt-scrollable and ember-scrollable from lt-body file. Plus ember-wormhole but that does not seems to have any impact. Also i updated my project to ember 2.9 See attachments here: This solution is to acceptable in case as i do not want to change stuff in library. Is there any other way to remove ember scrollable from this ? And also lt-scrollable. |
Very good stuff @andreikun! I'm seeing huge performance rendering issues when using a large set of rows with a lot of columns. How many rows and columns were you using in your testing? I would assume that some sort of scroll handling needs to exist if rows overflow from the table's container. Although, not sure if ember-scrollable is necessary for that. |
Used 7 columns with 18 rows, also with my screen minimized to tablet viewport (900px width) to be able to add that row-toggle component (as in official responsive table example) to be able to display hidden columns for each row. Also, it seems that it takes lot of time to render first column which is a column only for toggle
My last column also is rendering a component with 3 buttons inside.
See here performances. |
I'm almost ready for people to start trying out the latest smoke-and-mirrors, which has 5 major perf improvements in it and would address this:
|
Also, Ember 2.10 beta with Glimmer2 will be substantially faster than Ember 2.9 @andreikun |
@runspired going to be patient and wait then for Ember 2.10 release. Really do not want to have performance/loading issues even on a 20 rows table, without even doing a request to server. @runspired can you see any benefit of integrating smoke-and-mirros if i do not have an infinite scroll on my table ? Any idea how i can integrate this into light-table ? Regards. |
@andreikun that plan is to integrate smoke and mirrors into ELT once @runspired releases a stable version. |
@offirgolan that sounds great! Thanks! |
FWIW as a workaround, we paginated our data. |
Any news on this? we still have some performance issues with a lot of rows using ember 2.11.0 |
Just chiming in here, as I'd love to an occlusion rendering solution baked into ember-light-table. :-) @offirgolan it seems that the smoke-and-mirrors is being somewhat "abandoned" in favor of breaking it into several smaller components (https://github.com/html-next/vertical-collection), has this affected these plans at all? Source: https://build.addepar.com/engineering/rendering-10-million-items-with-vertical-collection/ |
@billdami I've been looking into |
It should be at least as stable as smoke-and-mirrors at this point :P |
also, smoke-and-mirrors is absolutely not being abandoned :P |
@offirgolan any update on this? currently using in my app that has 1000+ rows and sadly isn't working 😢 |
FWIW, there is a package based on S&M called vertical collection that may be used in regards to the suggestion someone left earlier about only rendering tables that are in the viewport as a user scrolls. |
Hey all... sorry for the radio silence. |
@alexander-alvarez I can't promise, that I'll be able to invest much time in the next week, but I'm very interested in getting this to work. It might be sensible to keep #284 in mind while implementing occlusion rendering depending on whether or not (and how) |
Hey all... sorry once again for the lack of communication. I finally got around to dedicating an entire evening to tackling this problem from when I last had a couple of months ago (unfortunately, I had to refresh from where I left off). Tonight, I realized that the way I was approaching the problem -- drop in replacement & everything working -- meant we wouldn't see any progress on this piece of functionality, and would slow down it's delivery. So I've decided to break it up into more manageable pieces so that we can get the table out into people's hands as early as possible and then add functionality iteratively. I'm building out a That being said, the goal for my first PR to the repo will be a table that can uses Please stay tuned, and keep me honest so we can push this forward. |
Yes, that! Most (99%?) cases require performance OR features, not both (hence, "performance XOR features"). Someone may have a counterexample, but the approach you've described and started to work on, @alexander-alvarez, seems perfectly reasonable to me. Congrats, I can't wait! |
Sorry for the wait -- #483 |
Hi again,
I've noticed a performance problem and I haven't figured out what is causing it yet. I tried attaching the profile but github doesn't allow .cpuprofiles. You can easily reproduce it by profiling the demo table at http://offirgolan.github.io/ember-light-table/#/. The rendering speed isn't that noticeable since you're only rendering ~20 rows off the bat but even at ~150 rows, rendering speed is at ~2.5 seconds. I've reduced my table down to one row and have noticed in the profile that the one row creates about 3 large spikes that have a huge number of function calls. You can see spike after spike, for each row, if you profile the demo page.
I'm continuing to investigate. We really like
ember-light-table
but this performance issue is a show-stopper at the moment. Cheers,Zach
The text was updated successfully, but these errors were encountered: