Support Generators in IonMonkey
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox53 | --- | affected |
People
(Reporter: till, Unassigned)
References
(Blocks 14 open bugs)
Details
Comment 1•8 years ago
|
||
Updated•6 years ago
|
Hi,
We are using a generator heavy approach in a new web component. Turns out it runs really slowly in Firefox. Found this jsperf (https://jsperf.com/generator-overhead-2) and tried it on Chrome, Safari and FF on my machine. Safari was roughly twice as fast as FF, Chrome seven times faster. Any hope of this improving soon? Would be great!
Regards,
Johan Isaksson
Comment 4•5 years ago
|
||
Any hope for this issue to be resolved? Is it on the radar at least (included in the roadmap)?
Comment 5•5 years ago
|
||
(In reply to Nickolay Platonov from comment #4)
Any hope for this issue to be resolved? Is it on the radar at least (included in the roadmap)?
From what I recall this was in the pipeline for December 2019, however, we since decided to simplify a lot SpiderMonkey to reduce the security risks related to IonBuilder usage. There is a project which is currently investigating the simplification of IonBuilder, and maybe replace it by WarpBuilder (Bug 1613592).
While this is not directly related, this is a higher priority at the moment.
I will raise this topic to the team, to see if we should raise the priority of generators in IonMonkey.
Comment 6•5 years ago
|
||
Thanks for the update! Yes, please draw some attention to this issue. We wrote a "modern" system, that uses generators a lot, and discovered the performance in FF is very bad (#1565549). In the same time its so powerful feature, arguably a best addition to JS spec in its history.
Comment 7•5 years ago
|
||
Yeah we expect this to be significantly easier with WarpBuilder in the future. Note though that Ion/Warp-compiling them is just part of it, generators also require more environment objects right now, and that could be a bigger issue than them not running in Ion.
Updated•2 years ago
|
Updated•1 year ago
|
Hi,
Any hope of generators getting optimized any time soon? We have for the last 5 years had to recommend our customers to pick another browser when using our components, ideally they should be able to use Firefox too.
Comment 10•10 months ago
|
||
Adding my voice here too, this is becoming a critical defect for us. Seems odd that FF is so far behind Chrome and the rest for 8+ years.
Do you offer a way for us sponsor a fast-tracking this implementation?
Comment 11•10 months ago
|
||
Is there a public website we could use to reproduce the performance problem you're seeing? If not, maybe you could share a performance profile from the Firefox profiler?
Comment 12•10 months ago
|
||
See a benchmark here for a example: https://bugzilla.mozilla.org/show_bug.cgi?id=1565549
Comment 13•10 months ago
|
||
@Jan de Mooij - Any idea if we could somehow sponsor the fast-track of this bug?
Comment 14•10 months ago
|
||
(In reply to Mats from comment #13)
@Jan de Mooij - Any idea if we could somehow sponsor the fast-track of this bug?
At this point it would be most useful for us to have access to a website that demonstrates the performance problem. That would help us determine if there's low-hanging fruit, other performance issues, parts we could prioritize, etc.
Comment 15•10 months ago
|
||
Isn't this test case enough? https://bugzilla.mozilla.org/show_bug.cgi?id=1565549
Comment 16•10 months ago
|
||
(In reply to Mats from comment #15)
Isn't this test case enough? https://bugzilla.mozilla.org/show_bug.cgi?id=1565549
The code that's being used on an actual website is likely pretty different from the micro-benchmark linked there. There are multiple parts to optimizing generators and we just want to make sure we're looking at a representative benchmark, to avoid optimizing something that isn't relevant for your framework.
Comment 17•9 months ago
|
||
To examine things on real website, please do the following:
- Open the https://bryntum.com/products/gantt/examples/bigdataset/ page. (If you'd like to check other examples, see https://bryntum.com/products/gantt/examples/)
- In console, type:
window.DEBUG = true
- Click the "5K Tasks" button in the top toolbar. This will switch the example gantt to a new dataset of 5K tasks.
You should see the following output in console:
For Chrome:
window.DEBUG = true
true
generate: 25.85107421875 ms
Initializing project
Populating project: 887.9541015625 ms
Time to visible: 5474.97509765625 ms
Finalize propagation: 708.40185546875 ms
For Firefox:
window.DEBUG = true
true
generate: 303ms - timer ended
Initializing project
Populating project: 18714ms - timer ended
Time to visible: 168067ms - timer ended
Finalize propagation: 21519ms - timer ended
What happens here is:
generate
- the example data is generated. Generation uses generators, perhaps that explains the 10x slowdown compared to Chrome, however, this is not a primary metric we are interested in.Populating project
- example data is loaded into "reactive graph". This does not involve generators, but instantiates lots of small objects (like hundreds of thousands of them). 21x slowdown compared to Chrome, would be great to see it optimized to be comparable.Time to visible
- this metric is the topic of this issue. Here the "reactive graph" calculates the final state. 30x slowdown compared to Chrome. Calculations are generators-based. During calculations, it also allocates the edges in the graph (populates lots ofMap
instances).Finalize propagation
- not related to generators, 30x slowdown.
Hopefully the numbers are self-explanatory, if you need any other information and/or benchmark, please let me know.
Probably one need to optimize the allocation speed too, because the most important metric Time to visible
is a combination of generator calls + allocation. In particular, the allocation of Maps, and internal allocations by Maps. I'll open a new ticket for that.
Comment 18•9 months ago
•
|
||
Just opening https://bryntum.com/products/gantt/examples/bigdataset/
Nightly: https://share.firefox.dev/4b9raNf (3s)
Chrome: https://share.firefox.dev/4bb4Umm (1.8s)
Clicking on 5K
Nightly: https://share.firefox.dev/3UQdzVo (12s)
Chrome: https://share.firefox.dev/3WPzMVd (3.5s)
With window.DEBUG = true , I generally get 11s with Firefox. But one time, Firefox took 45s.
Comment 19•9 months ago
|
||
Separate issue to optimize the allocations: https://bugzilla.mozilla.org/show_bug.cgi?id=1895667
Comment 20•9 months ago
|
||
Thanks, that's helpful.
There's some generator overhead, but it's mostly time spent elsewhere. There are slow GetProp ICs that might benefit from bug 1878158. These are mostly looking up fieldMap
and getFieldDefinition
properties. There's also some Map
overhead (bug 1851662).
Comment 21•9 months ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #20)
There are slow GetProp ICs that might benefit from bug 1878158. These are mostly looking up
fieldMap
andgetFieldDefinition
properties. There's also someMap
overhead (bug 1851662).
To expand on this a bit: the JS code has a lot of JS getter functions. If you could make these non-getter properties it would likely make things faster in all browsers.
Comment 22•9 months ago
|
||
Thanks for pointing, we'll try to improve in this regard.
Comment 23•9 months ago
|
||
@Jan de Mooij: Just checking in, is this being worked on by anyone? We are facing massive issues in our business due to this issue (and related perf issues above)
Comment 24•9 months ago
|
||
So, this isn't being actively looked at at the moment. But what I am going to do is spin the Bryntum specific aspect of this bug out into another bug. This is the wrong bug to be having all this discussion.
Comment 25•9 months ago
|
||
I've opened Bug 1898545; we should move discussion of Bryntum specifically there.
Comment 26•3 months ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE
.
For more information, please visit BugBot documentation.
Comment 27•2 months ago
|
||
Any updates on this? Do you have an ETA when Generators will be properly supported?
Comment 28•2 months ago
|
||
No update; in the hierarchy of things to work on unfortunately this still is quite low.
Comment 29•2 months ago
|
||
Ok that's unfortunate. Any option for us to pay/sponsor this issue to increase priority?
Comment 30•2 months ago
|
||
Based on the profiles in bug 1898545, I think generators are not the primary cause of your performance issues.
Description
•