egonSchiele / contracts.ruby

Contracts for Ruby.
http://egonschiele.github.com/contracts.ruby
BSD 2-Clause "Simplified" License
1.44k stars 82 forks source link

Excessive CPU consumption while scrolling doc #290

Closed eugene-nikolaev closed 5 years ago

eugene-nikolaev commented 5 years ago

Thanks a lot for your awesome work!

Excuse me for a bit weird report. But it is really important for me as I read the docs moving here and there and it is painful now.

This page: http://egonschiele.github.io/contracts.ruby/ consumes too much CPU resouces while scrolled in browser (recent Chrome). I have pretty powerful desktop running at 3.8GHz but the scrolling manage to load all its cores. I've made a little investigation and learnt that the cause is "linear-gradient" at your style.css. When I remove it (I've used Printliminator:Remove all graphics from https://css-tricks.github.io/The-Printliminator/), it allows to scroll very fast without any lags. And the view of page doesn't change at all (or too insignificant). I propose to remove those gradients to improve UX.

egonSchiele commented 5 years ago

How did you do the investigation @eugene-nikolaev ? I'm actually using one of the default templates that come with Github pages, so I have no control over the css.

eugene-nikolaev commented 5 years ago

I've used Chrome DevTools. Task manager and element inspection particularly. Scrolling on this template with linear-gradient consumes 200+ percent of 2 cores.

eugene-nikolaev commented 5 years ago

so I have no control over the css

I understand. Though I guess it could be done via style.css with !important directive or js hack.

eugene-nikolaev commented 5 years ago

Well, @egonSchiele, that's not that critical for me, I've just saved the webpage and customized it. It is OK as long as it is a single page :) I just thought you might be interested to know there were a UX issue.

eugene-nikolaev commented 5 years ago

Hm, it seems the issue conditions can be narrowed down to Chrome + Intel HD. Nor FF on Intel HD nor Chrome on discrete video are affected. BTW thanks for you work, I've just discovered "method overriding" and it is amazing.

egonSchiele commented 5 years ago

Oh interesting, good to know. Thanks for digging deeper! It seems like a minor issue to me so closing sgtm