Code Monkey home page Code Monkey logo

Comments (6)

TimoStaudinger avatar TimoStaudinger commented on August 27, 2024 1

@zouhir I found the numbers on the dashboard a bit confusing as well, so I dug into it a little. It seems like the way it is implemented right now messes up some units along the way:

let time = assetsSize / 1024 / (i.internet_speed * 1024 / 8) + i.rtt;

, where assetsSize is the size of the bundle in kB if I'm not wrong, converted to MB via assetsSize / 1024. i.internet_speed is the bandwidth in mbps, converted to kbps via i.internet_speed * 1024, and to kBps via ... / 8. That means, we effectively compare MB to kBps here.

Also, I believe the RTT, i.rtt, is listed in milliseconds, not seconds, so we are adding milliseconds to seconds without conversion.

I took the example from the screenshot in the read-me, with a bundle size of ~920kB, and did some calculations in Excel:

speed

Those times seem much more reasonable to me than what we are seeing in the screenshot, e.g. ~180s download time of ~920kB via 4G.

Considering those points, I believe the correct formula should be:

let time = assetsSize / (i.internet_speed * 1024 / 8) + (i.rtt / 1000);

Let me know if I missed something. If you agree with my logic, I'll submit a PR later.

from jarvis.

zouhir avatar zouhir commented on August 27, 2024

Hey! Sorry for my delayed response.

Ultimately, your assets should load < 5s on your target audience connection type.

Your asset's in this photo will load under this budget for 20mbps connection only and you have 1s room.

I apologize as in this beta, things are not super clear but I'll definitely work on the UX and improve this section.

from jarvis.

hq229075284 avatar hq229075284 commented on August 27, 2024

In other word,except for 20mbps,everything else is fake data?

from jarvis.

zouhir avatar zouhir commented on August 27, 2024

No, it's connection speed data from webpagetest.org

Your bundle is huge :) or it's dev bundle, looking at Global Average

Connection Speed is: 0.4mpbs === 400kbps
RTT = 160ms

and your assets will take 182s to download on that speed (~3min)

from jarvis.

zouhir avatar zouhir commented on August 27, 2024

I swear I knew something didn't make sense in my quick and dirty calculations 😂 thank you for looking at this bit, your calculations are the correct ones, I welcome a PR!!!!

from jarvis.

hq229075284 avatar hq229075284 commented on August 27, 2024

I'm sorry to see the reply so late.I'm just as confused as @timosta is.Pack a small file, but display it on the dashborad for such a long time.

The explanation given by @timosta is detailed and taught.

thank you @zouhir @timosta

from jarvis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.