Skip to content
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

This has gotten slower with the updates when there are lots of options, like selecting a country #26

Closed
robclancy opened this issue Jan 9, 2020 · 19 comments

Comments

@robclancy
Copy link

No description provided.

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

Hmm, I do have a vague test to check it's not regressed in speed.

I wonder, for your use case, is using native <option>'s an option?

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

I have been frustrated in the past with the slowness of the component. Considering all it is doing is comparing 1 value with another, I would expect it to be lightning fast. So I can only attribute the slowness to the quantity of components (i.e. Ember's component construction time). But it's definitely worth investigating more

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

I've also noticed a larger than expected difference in development speeds vs production speeds

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

I'm going to set up a dedicated test app

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

...ok, I don't think this has got any slower recently.

But it does seem to be a downside of the architecture - In that each option is a component.

@robclancy
Copy link
Author

robclancy commented Jan 10, 2020 via email

@amk221
Copy link
Contributor

amk221 commented Jan 10, 2020

Thanks,

I focused my investigation on the option components (I don't think it's anything to do with the parent component).

The only things that seem to have an impact are:

https://github.com/zestia/ember-select-box/blob/master/addon/components/select-box/option.js#L54-L60

and these bindings:

https://github.com/zestia/ember-select-box/blob/master/addon/templates/components/select-box/option.hbs#L2-L9

(i.e. commenting those things out speeds it up)

@robclancy
Copy link
Author

I commented those things out and I still have the same issues. Also I have some slowdown on selecting an item. I need to test with the same dropdown but without all my changes to rule those out. But won't have time for a while.

@amk221
Copy link
Contributor

amk221 commented Jan 13, 2020

Hmm! would it be possible for you to create a demo app? I would like to get to the bottom of this.

Here's the one I was using https://github.com/amk221/select-box-test/blob/master/app/templates/application.hbs

@robclancy
Copy link
Author

I did a quick test with that. I went back to version 11 and it took around 1 second to open. Then back to current and it took 2 seconds. Measuring in profiling and only once, but that big of a difference I don't think I need to test more to know there is an issue. But it's really hard to know what.

I'm running on a faster pc now, with a ryzen 5 2600. And I know people use pretty slow things at the office which is my main concern. Right now I have hidden any performance issues (they get it when opening a modal, instead of when opening a select which is a nicer user experience).

Still seems like the main issue might be ember. And in other cases people have gotten around having so much to render in different ways. What I might try later is simply staggering the first render, where I add the options frame after frame to try stop the blocking.

It's also weird the beta did a bunch of polyfills etc whereas the current version you do things more up to date with ember but now the issue happens. So could be solely an ember issue.

@robclancy
Copy link
Author

Okay so I thought production might also be a factor, it didn't change much locally for some reason but now that I have deployed with these updates the performance is far better. 200ms. Still slow but for how many coountries there are I would consider that pretty good.

So there might not actually be an issue, could just be part of local env with glimmer.

@amk221
Copy link
Contributor

amk221 commented Jan 14, 2020

Thanks rob. That seems to be my conclusion too. It is slow in my local dev environment, and even more so with the dev tools open. And like you found, production builds seem ok.

The next step for the addon is to extend from @glimmer/component. Hopefully things will get better

@amk221
Copy link
Contributor

amk221 commented Mar 1, 2020

I’ve updated to glimmer (see v14.0.0.beta) and the slowness persists. I will create an issue on the ember repo. I feel like it’s shouldn’t be this slow.

@amk221
Copy link
Contributor

amk221 commented Mar 6, 2020

emberjs/ember.js#18798

@amk221
Copy link
Contributor

amk221 commented Apr 5, 2020

Some progress on this
emberjs/ember.js#18861

@robclancy
Copy link
Author

I tried it out and didn't see that much difference but I have my own hacks in there to help. Going to close this issue anyway since it isn't really a problem this addon can solve.

@amk221
Copy link
Contributor

amk221 commented Jun 30, 2020

Just wondering if you've noticed any difference recently?

@amk221
Copy link
Contributor

amk221 commented Jun 30, 2020

I tried ember-source 3.19 on the test repo mentioned above, and there was a huge improvement.

@robclancy
Copy link
Author

I can't really check too easily now but what I could did seem a lot faster on 3.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants