Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
My website is taking so much CPU on my computer

here is my performance for 2 secondsThe tab that has 36% cpu usage is the tab of my website

I'm using django with pure css and js in this project and it seems that my website is consuming so much cpu, also i'm using a gradient animation with css:

body {
  background: linear-gradient(to right, rgb(247, 85, 202), rgb(18, 103, 248));
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}
.nav-link,
.navbar-brand,
.nav-link:hover,
.navbar-brand:hover {
  background: linear-gradient(to right, rgb(247, 85, 202), rgb(18, 103, 248));
  -webkit-background-clip: text;
  background-size: 400% 400%;
  color: transparent;
  animation: gradient 15s ease infinite;
}
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

In addition i'm using an event listener to the whole document using Javascript:

document.querySelectorAll('.edit').forEach((button) => {
  .
  .
  .
})
document.querySelectorAll('.filter-green').forEach(like => {...})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your problem is the use of animation on gradient background - if just on the body element then on my system (Windows 10/Edge reasonably powerful laptop) I don't see so much CPU being utilised, but the GPU usage is very high (around 48%).

If I then bring in the animations on the other two elements which have animated backgrounds the GPU goes up to anything between 60% and 75%.

So start by deciding what really has to have an animated background. I suspect it's the body that you want to show this, and remove the animations from the other elements.

You still have high either CPU or GPU usage and your users will not thank you for such battery-flattening behavior.

I would suggest you either scrap the idea of animating this type of gradient or at minimum provide a way for your users to switch it on and off. In any case, pay attention to whether they have asked for a low-motion site - some people react badly to movement on the screen.

See MDN for info on accessibility and animation.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda