question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Awful performance on mounting caused by the iframe

See original GitHub issue

In v2, when dynamically adding multiple charts (let’s say 15), the performance is awful. This seems to be caused by the helpers.addResizeListener, which is taking an awful lot of time, blocking everything.

Here are some screenshots where I also have the AdBlockPlus extension installed, which is doing some things on the iframe’s element:

screenshot 2016-02-17 18 43 56 screenshot 2016-02-17 18 44 21 2 screenshot 2016-02-17 18 45 45 2 screenshot 2016-02-17 18 46 54 2

After uninstalling the extension, there is less time spent on Parse HTML, but the execution of helpers.addResizeListener still takes way too long.

screenshot 2016-02-17 18 58 20 2

screenshot 2016-02-17 18 58 32 screenshot 2016-02-17 19 00 48 2

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
etimbergcommented, Feb 18, 2016

@IonutLaceanu thanks for the detailed bug report. I can confirm that helpers.addResizeListener is slow on my machine (~4.5ms).

It looks like a lot of the time is spent in insertBefore. Further, I noticed a typo that classlist should be classList. I’m sure that doesn’t help performance either.

0reactions
mrjacobbloomcommented, Aug 24, 2017

also worth keeping an eye on (but not usable yet): https://developers.google.com/web/updates/2016/10/resizeobserver

Read more comments on GitHub >

github_iconTop Results From Across the Web

iFrame Performance: Part 1, The Bad News | by Max Rafferty
Taken all together, there is not a lot of good news on this front: iFrame performance is, generally speaking, terrible.
Read more >
3 Reasons You Might Not Want To Use Iframes - OSTraining
Reason #2. Iframe Cause Usability Issues. The iframe tag is notorious for creating usability annoyances. Among most common of them are:.
Read more >
Using Iframes Sparingly | High Performance Web Sites
If the contents of the iframe are as important, or more important, than the main page, this is fine.
Read more >
The ultimate guide to iframes - LogRocket Blog
Not a fan of iframes? This post provides an overview of the tag's best features, shows you how to use them, and how...
Read more >
Best practices for using third-party embeds - web.dev
This article discusses performance best practices that you can use when loading third-party embeds, efficient loading techniques and the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found