Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Investigate and eliminate lag with default Twitter site #13

Closed
kurisubrooks opened this issue Dec 8, 2017 · 3 comments
Closed

Investigate and eliminate lag with default Twitter site #13

kurisubrooks opened this issue Dec 8, 2017 · 3 comments

Comments

@kurisubrooks
Copy link

Hope this is worth looking into;
I experience pretty intense lag on both my desktop (powerful gaming pc) and my laptop (macbook air) after having the site open for a couple of minutes (with & without this extension installed) it slowly becomes unusable due to the sheer amount of lag between actions, specifically scrolling, liking tweets, videos lagging, etc. Taking a look into Chrome's Task Manager i've found, whilst having multiple tabs open, Twitter has both the highest CPU usage and most memory usage of all of my tabs open.

I'd greatly appreciate if this could be looked into, as it would certainly make the site alot more usable to people who experience the same issue as I. Thanks a bunch!

screenshot 2017-12-08 10 58 22

@sindresorhus
Copy link
Owner

sindresorhus commented Dec 8, 2017

For anyone wanting to look into this, try using the "Performance" tab in Dev Tools.

@sindresorhus sindresorhus changed the title Investigate & Eliminate Lag with Default Twitter Site Investigate and eliminate lag with default Twitter site Dec 8, 2017
@obahareth
Copy link

Here are a couple of screenshots from the performance tab:

screen shot 2019-02-13 at 4 52 25 pm

screen shot 2019-02-13 at 4 52 33 pm

screen shot 2019-02-13 at 4 53 59 pm

The content.js in the last image is from refined-twitter.

This is the minified code of the first one:

const f = (new (n.n(l).a)).getAll()
      , d = async({fn: e, id: t=e.name})=>{
        u || (u = await f);
        const {logging: n=!1} = u
          , r = n ? console.log : ()=>{}
          , a = t.replace(/_/g, "-");
        if (/^$|^anonymous$/.test(a))
            console.warn("This feature is nameless", e);
        else if (!1 === u[a])
            return $("html").removeClass(a),
            void r("↩️", "Skipping", a);
        try {
            $("html").addClass(a),
            await e(),
            r("✅", a)
        } catch (e) {
            console.log("❌", a),
            console.error(e)
        }
    }

And this is the second one:

()=>{
  Object(i.b)(o.b.codeHighlight),
  Object(i.b)(o.b.mentionHighlight),
  Object(i.b)(o.b.inlineInstagramPhotos),
  Object(i.b)(o.b.renderInlineCode),
  Object(i.b)(o.b.imageAlternatives),
  Object(i.b)(o.b.hideRetweetButtons)
}

I haven't looked deeply enough to see why these are slow, but I thought I'd at least log my findings here. These were the top two function calls in terms of total execution time.

@sindresorhus
Copy link
Owner

Closing as this extension is now deprecated: 8dd9df7

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

No branches or pull requests

3 participants