-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Es6.array.from and Es6.array.iterator do something with Float32Array/Array? which makes it 100x slower on Chrome #377
Comments
Can I help anything with this issue? |
@vlajos now I have no time for exploring this issue. Feel free explore it and propose changes. |
@zloirock I tried to dig a bit deeper.
And if I comment out that line, the problem disappears. (Or if I return after/before that line in the original function.) I tried to revert A little shorter example:
(I'll carry on, just wanted to share these results first...) |
Funny. Seems somehow any array with a custom iterator somehow deoptimise array iteration (which also used in typed array constructors) in V8. |
@zloirock |
You could report it. It's detection of support iterables in methods / constructors which should accept it. It's possible to do it without that assignment, but IIRC that caused some problems in some old |
I added a workaround to v3 branch. Feel free to test it. If it will cause some problems, I will revert it. |
@zloirock Thanks! I have just tried it, but there is no difference.
Just do double check if the new code is applied:
But the speed of the test is still the same. |
So seems the problem not (or not only) in this code. |
I reworked typed arrays and iterators polyfills, found some cases which can theoretically somehow deoptimise it and now, after calling your test, seems it's fixed in |
@zloirock Thank you very much. The test is definitly quick now. Do you think I could test our "full" app against the v3 branch? Is it stable enough? |
@vlajos yes, now it's enough stable, today I finished testing on all supported engines. Seems actual version of |
|
@zloirock Thanks. I checked earlier and i can confirm that our app works properly with |
@vlajos nope, it's duplicates after rebasing. |
Demo scripts:
http://lavela.hu/bug/test-array.from.html
http://lavela.hu/bug/test-array.iterator.html
http://lavela.hu/bug/test-array.others.html
Speed results on my machine:
Other notes:
new Float32Array(arr)
operation is getting slower.Version 64.0.3282.119 (Developer Build) built on Debian buster/sid, running on Debian buster/sid (64-bit)
(But I had the same results on 63.x on Windows.)Related flamegraphs from chrome:
(The story started originally here: pixijs/pixijs#4662 and here: babel/babel#7362 But I think I copied everything relevant here.)
The text was updated successfully, but these errors were encountered: