-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BUGFIX release] Fix classify for spaced strings #13044
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
Conversation
|
Will need to be |
|
Tests are passing locally for me; not sure why they aren't in Travis. Please excuse the debugging. |
|
Looks like it's a difference of phantomjs versions. 1.9.8 doesn't handle RegExp's Fortunately in this case, getting rid of the |
|
The fix looks good to me. I believe the performance impact (adding a loop of regexps) to be a somewhat negligible difference due to the caching we do with these methods, but I would love @stefanpenner or @krisselden to confirm/deny. |
|
One potentially better solution, if the loop is too much of performance concern, might be to add a regexp to handle the specific case of a one-character piece (which is, I believe, the only time this bug manifests). |
|
does ember or ember-data use classify anywhere? I don't know if its even relied upon, which leads me to believe it wont affect performance for most people. |
|
ember-data does not use it. uses that I am aware of:
|
ah, hmm. resolving type should usually be a cache hit, as the number of types are relatively low. The only way to be sure is to test it in a large app, and see how many hits/misses etc. |
|
@stefanpenner - Ya, exactly. I think the resolver lookups would definitely be nearly all cache hits (there are only like 5 or 6 types in the system). |
|
Next step here would maybe be to recreate an app with a lot of lookup in https://github.com/eviltrout/ember-performance and confirm there isn't a regression. Or alternatively make a one-off regression check against a real app. |
|
☔ The latest upstream changes (presumably #13381) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #13658) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@mixonic Created a benchmark with ember-performance eviltrout/ember-performance#107 Each test run classifies 1k random strings. Results:
|
|
Seems like close enough performance, give one is horribly broken and the other one works. |
|
@skeate - Would you mind rebasing one last time, then we can land this? |
|
well I've gone and completely hosed this up |
|
Also: Are those columns mislabeled, or am I misinterpreting, or is this PR somehow faster than what's in master? |
|
@skeate yeah it looks like the PR performs better. I expect b/c the |
We should be careful, as we have caches involved here. Real apps may blow this limits and cause some grief, as the micro benchmark path and real path may be substantially different. We will have to be careful and do some tests in real apps. These caches have statistic tracking built in so it should be possible. @krisselden this might be a good thing to try in one of the LI apps. |
|
I also think, this shouldn't be a |
|
@stefanpenner per the original issue #13042 this is a regression in 2.4 not present in 1.13 or 2.0. Seems pretty major, it seems unlikely any app relies on a classified string have a space 😬 Ideally still a |
|
ah its a regression, i see. |
|
@skeate they were mislabeld. Sorry. I had meant to attach screenshots, but could not because of conference wifi. |
|
Did anyone had time to perf this? Anyway I can help? |
|
I believe this blocked on a performance regression check in a real app, per @stefanpenner's comment. Embarrassingly, this regression has been around a whole LTS cycle. |
|
Hi @skeate, I am sorry that we let this PR sit in limbo for so long. We have discussed this in the last core meeting and we decided we weren't comfortable changing the behaviour of an API that has been around for so long–mea culpa. Instead, we would like to actually deprecate this and some similar methods, and move then to an addon. This way you can use the addon if you want the current behaviour, you can use another library like lodash, or you can implement it yourself. |
Resolves #13042