Skip to content

Why does it takes longer to Servo to load firefox.com than Firefox? #10425

Closed

Description

@paulrouget

To load firefox.com in Firefox, it takes 2.4s (performance.timing.loadEventEnd - performance.timing.navigationStart). In Servo, it takes 10s (time between iframe.src = "http://firefox.com" and mozbrowserloadend).

Do we know the reasons?

I guess the lack of speculative HTML parsing (#3847) is one of the reasons. Anything else?

Activity

  1. frewsxcv commented on Apr 6, 2016

    @frewsxcv
    Contributor

    Relevant to #8940

  2. added
    I-perf-slow
    on Apr 6, 2016
  3. Manishearth commented on Apr 6, 2016

    @Manishearth
    Member

    It should be speculative HTML parsing and fetching. If a website has a bunch of external scripts (e.g. twitter) it takes forever to load since the scripts load one after another with fetches in between. Firefox probably fetches them all in parallel whilst loading.

  4. metajack commented on Apr 6, 2016

    @metajack
    Collaborator

    We know one concrete reason, which is that we start loading resources later due to not having speculative HTML parsing.

    Another reason is that if you have a warm cache in Firefox, you're probably skipping a lot of the network requests outright, and Servo currently has no cache.

    There are probably more reasons, but right now we don't know what they are.

    I am hoping @nox's work getting the performance tab up in devtools will help us diagnose other issues.

  5. paulrouget commented on Apr 6, 2016

    @paulrouget
    ContributorAuthor

    I am hoping @nox's work getting the performance tab up in devtools will help us diagnose other issues.

    What about window.performance.timing? That would help a lot.
    Filed #10428

  6. jdm commented on May 6, 2016

    @jdm
    Member

    Good catch! My profile trace reports 4.5s spent in the same step that #11008 hangs in.

  7. jdm commented on May 6, 2016

    @jdm
    Member

    That said, on subsequent runs I can't reproduce the long connection time :/

  8. metajack commented on May 17, 2016

    @metajack
    Collaborator

    @jdm reports that speculative HTML parsing is not the top issue on any profile he's investigated, so I think we should focus our efforts elsewhere. It's not yet the lowest hanging fruit.

  9. nox commented on Jun 2, 2016

    @nox
    Contributor

    I cannot reproduce this anymore.

  10. nox commented on Jun 2, 2016

    @nox
    Contributor
    <iframe style="width:700px;height:500px" mozbrowser="true" src=""></iframe>
    <script>
      var now;
      var iframe = document.querySelector("iframe");
      setTimeout(() => {
        iframe.addEventListener("mozbrowserloadstart", () => { console.log("start") });
        iframe.addEventListener("mozbrowserloadend", () => {
            console.log(new Date().getTime() - now);
            console.log("end");
        });
        setTimeout(() => {
          now = new Date().getTime();
          iframe.src = "http://firefox.com"
        }, 1000);
      }, 1000);
    </script>
    ± ./mach run -r --pref dom.mozbrowser.enabled firefox.html
    start
    1634
    end
    
  11. paulrouget commented on Jun 2, 2016

    @paulrouget
    ContributorAuthor

    Agreed. It's a lot better than before. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkI-perf-slow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions