Coder Social home page Coder Social logo

Comments (9)

rrichardson avatar rrichardson commented on May 3, 2024 13

My issue with the clouds is that they're moving in the same direction that the rocket is pointing. They should be moving to the left to simulate relative motion. ;)

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 7

The clouds are indeed causing quite a lot of CPU usage. I've optimized the drawing rate to try to minimize the effect. The CPU usage has decreased on my machine by about 70%. Hopefully this is sufficient to consider the issue closed. I really like the clouds. :)

Oh, the clouds now go the other way, too! ☁️ 🚀

from rocket.

rafbm avatar rafbm commented on May 3, 2024 6

The new requestAnimationFrame code seems to decrease CPU usage on Chrome indeed. Still feels high IMO. One sure thing is that Safari performs insanely better than Chrome on this. However, the SVG icon rendering in Safari looks blurry, reminiscent of 1x images rendered on Retina.

How about open sourcing the website into its own repo so the community can help with that stuff? 😃

from rocket.

amarshall avatar amarshall commented on May 3, 2024 1

The homepage currently consumes 150% CPU usage in Chrome 64 (per Chrome’s task manager). Seems pretty high for an animation that’s not relevant to the content.

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 1

@dmikusa-pivotal Agreed. This is bad. I've rewritten the code to use individual cloud images as opposed to two large images with the theory that the renderer should be able to reuse previously painted screens. This had reduced the CPU load by 200x on my machine. I will push the changes live as soon as I polish the implementation.

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024

Looks like we're okay on the clouds now. :)

@rafbm I plan open sourcing parts of the website, especially the guide, but I've struggled in choosing the right license. Happy to discuss this in #rocket. :)

from rocket.

LifeIsStrange avatar LifeIsStrange commented on May 3, 2024

I think the animation should be using CSS (GPU).
on local replacing the two cloud divs by spans (workaround for disabling the current expensive animation) make the cloud static.
then add the css class span.clouds {
background-position-x: -247.585px;
transform: translateX(-300px);
transition: transform 8s;
}
make clouds moove smoothly.
Values should be finetuned and reseting the position once reaching end of screen is not done (could be done in js)

from rocket.

dmikusa avatar dmikusa commented on May 3, 2024

I still see quite high CPU usage as well (Firefox 68.0.1 MacOS). The animation is neat, but when I'm trying to read the docs and not looking at it, it's still killing my battery. Maybe stop it after a certain amount of time, number of iterations across the screen, or add a little stop button or something? Just a suggestion. I will use Safari for now.

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024

The fix in my previous comment has now been deployed!

from rocket.

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.