Coder Social home page Coder Social logo

Comments (13)

alextes avatar alextes commented on September 28, 2024 1

Yes, I've been eyeing these metrics and wanting to improve them for a while πŸ™ˆ .

I'm glad someone popped up and started plucking some great low-hanging fruit, thank you πŸ’› .

I just spent some time refactoring things and have to get back to some features on the roadmap but I tend to pick these things up anyway along the way because they never get done otherwise. So both creating issues with great opportunities is helpful, as well as any PRs. I'll always make time to review those.

Ping me on Telegram https://t.me/smilingalex if you'd like my input on anything or I don't react to a PR!

from frontend.

alextes avatar alextes commented on September 28, 2024 1

Yea Lighthouse is great!

Well, I think that would depend on what you prioritize no? Downloading 30Mb of images is pretty terrible by any standard, don't get me wrong, but I think our audience is more interested in the time to first paint and interaction, and less interested in downloading a couple more megabytes. Nevertheless, I'm happy we improved it! Thanks for the help.

You'll also see Lighthouse mentions the same, reducing initial load with a smaller JS payload is nr3 on the list:

Screenshot 2022-08-19 at 10 42 29

I vaguely recall the lib was also one of the bigger ones on the treemap in Lighthouse but not 100% sure now.

from frontend.

alextes avatar alextes commented on September 28, 2024 1

Another thing that came to mind, Lighthouse doesn't like our large DOM size. To some extent this is hard to overcome as the page is a dashboard and those tend to have a lot of nodes. However, we have a bunch of lists containing many items, which could wait with rendering those items. I think those might be the biggest DOM size savings available to us.

Then secondly we're exploring a design where each section lives in its page, that would help a lot.

from frontend.

alextes avatar alextes commented on September 28, 2024 1

Another idea: our SVGs are a mess. Looking at the network panel a lot of our requests are SVG, if we switch from:

<img href="/svg-icon.svg" />

To:

import svgIcon from "../assets/svgIcon.svg";
import Image from "next/image";
<Image href={svgIcon} />

Next will use clever caching techniques to skip the 304 check and majorly speed up the loading of the site, as about 50 requests can now be skipped.

If anyone wants to work on this, let me know, I'd propose we:

  • move all SVG used by a single component into the associated component folder.
  • all shared SVGs in a shared folder src/assets is fine for this, perhaps src/assets/svg-icon could be nice
  • re-export all SVGs at 100px (this won't matter for the size, but it does matter for how NextJS scales them by default! ping me and I'll take care of it, I'm happy to give access to our Figma file but SVGs are a mess there too)

The speed up from this on first and subsequent loads should be pretty big!

/cc @dawsbot our performance superhero πŸ¦Έβ€β™‚οΈ

from frontend.

alextes avatar alextes commented on September 28, 2024 1

@dawsbot no worries haha. Anything that isn't risky to merge, doesn't add tons of complexity for little gain, and improves performance is getting merged πŸš€ πŸ˜„ .

With the lazy loading, all I want to confirm is that we actually improve FCP / LCP / TTI before we merge anything that deviates from how Next would handle things by default, which seems pretty good.

I appreciate you'll try to keep it low-effort / low-stress for me to merge πŸ™ .

(PRs are in btw)

from frontend.

dawsbot avatar dawsbot commented on September 28, 2024

GTmetrix-report-ultrasound.money-20220817T073535-DZIUoUWL.pdf

image

from frontend.

alextes avatar alextes commented on September 28, 2024

Thinking about other potential improvements, we use a library to copy the πŸ¦‡πŸ”Š to clipboard, and its a very silly 50kb or so. We should try to find a piece of code we expect will work cross-browser / on phones, and use that instead.

from frontend.

dawsbot avatar dawsbot commented on September 28, 2024

Thinking about other potential improvements, we use a library to copy the πŸ¦‡πŸ”Š to clipboard, and its a very silly 50kb or so. We should try to find a piece of code we expect will work cross-browser / on phones, and use that instead.

Although that feels like an easy win, 50k is not actually a big issue at the moment. There are higher priority payoffs to fix first like the 4MB images βœ… I always try to do data-based improvements with tests like the GMetrix and lighthouse scores included above.

Thanks for being so responsive! πŸ™

from frontend.

alextes avatar alextes commented on September 28, 2024

We settled on a first pass for breaking up our dashboard page into sections. This should result in major performance improvements.

If anyone wants to work on it, just let me know!

Screenshot 2022-08-24 at 15 41 42

from frontend.

dawsbot avatar dawsbot commented on September 28, 2024

Excited to see progress on this! Would you like me to implement the MVP for the lazy loading @alextes ?

from frontend.

alextes avatar alextes commented on September 28, 2024

@dawsbot yea, if you like, can you maybe do a proof-of-concept with whatever piece would benefit the most from lazy loading? But no hurry from my side, feel free to do it post-merge too. It'll actually be tough to find time for this before the merge πŸ˜… .

With a proof-of-concept in a branch we could also take a look and see how it impacts our timings in lighthouse πŸ‘Œ .

from frontend.

dawsbot avatar dawsbot commented on September 28, 2024

Don't get cold feet on me now @alextes ! πŸ˜‚

I understand, I'll make a minimal example that's stress-free to merge. Something that really improves this loading, so that at merge, folks have a lightning-fast experience ⚑️

from frontend.

dawsbot avatar dawsbot commented on September 28, 2024

I'll wait until these get merged because of the diff it'll create: https://github.com/ultrasoundmoney/frontend/pulls

LMK @alextes

from frontend.

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.