You are not logged in.

#1 2015-12-02 15:58:09

domas
Member
Registered: 2015-12-02
Posts: 12

Poor performance in browsers when scrolling

Hello. I've recently revived this old laptop (HP nc4010) with bunsenlabs. I've been using it while travelling, working on the terminal and the browser. Consindering it's a 2004 laptop, I'm surprised at how well it works with BL. Nonetheless, there are a few quirks which complicate things.

Main problem: I get very poor performance when scrolling in a browser, and sometimes when loading a page. Due to other problems (webkit web inspector crashing the browser), I've switched through a couple of browsers and they all exhibited same behaviour. I've used uzbl, xombrero, iceweasel, google-chrome and am now on surf.

On lighter sites, like these forums, after some time I even forget that scrolling is choppy and slow. However, on thicker sites, with more graphics, javascript etc. it can get to a point where I have to spend minutes just scrolling to the information I need.

Watching htop and scrolling, cpu is at 4-5% when idle, but it can go up to 75% when scrolling even on a light site. I imagine it would be worse on a bigger site.

Things I've tried:

  • Compile the newest version of surf from git, together with more recent versions of webkit-1.0 and gtk+-2.0 from Debian's Stretch distribution. No effect.

  • Update/install ati drivers as described in Debian wiki. No effect.

     # apt-get install firmware-linux-nonfree libgl1-mesa-dri xserver-xorg-video-ati
  • Disable excess background processes, like conky and the compositor. No effect.

I'm out of ideas. Could you help debug this?

Last edited by domas (2015-12-02 16:42:36)

Offline

#2 2015-12-02 21:34:33

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Poor performance in browsers when scrolling

domas wrote:

Hello. I've recently revived this old laptop (HP nc4010)

http://www.cnet.com/products/hp-compaq- … 010/specs/

I get very poor performance when scrolling in a browser, and sometimes when loading a page. Due to other problems (webkit web inspector crashing the browser), I've switched through a couple of browsers and they all exhibited same behaviour.

no surprises there, and i don't think there's much you can do - this laptop simply isn't built for the internet of today.
one thing usually helps is to 'disable smooth scrolling' in iceweasel's settings, and play with the hardware accel settings (just try whether on or off works better).
you can try some research if you can do something about your graphics card driver - unlikely, outdated, but possible.

edit:
using dillo or netsurf might help, because they use a different, more limited engine to render the web.
but all webkit browsers will be more or less the same, whether it's surf or chrome.

edit2:
also disable compositing (openbox root menu => preferences => compositor).

Last edited by ohnonot (2015-12-02 21:42:34)


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#3 2015-12-02 22:17:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Poor performance in browsers when scrolling

I recommend using noscript -- most of the sites are very heavily scripted and this will tax your machine.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#4 2015-12-03 16:48:19

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

Thanks for the tips, playing with hardware acceleration and smooth scrolling helped on Iceweasel. Unfortunately these settings are not as accessible on surf, which is my preffered browser. Using netsurf, dillo or the like, does give a fluid performance, but unfortunately they break on some modern websites. I also have to stay with a modern browser, because from time to time I have to do some light web development.

Anyway, as for my laptop being outdated, I somewhat agree, but when it ran Windows, browsers performed noticably smoother. Also because of the spikes in cpu usage when pages are scrolled, it seems that the cpu is doing gpu's work.

I'll try play around some more with the drivers. If you have ideas, I'm all ears.

Offline

#5 2015-12-04 04:16:09

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Poor performance in browsers when scrolling

domas wrote:

If you have ideas, I'm all ears.

surf has some docs and options: http://surf.suckless.org/
but i fear that what you want would be influencing the webkit engine directly, which i think is possible but how...

adblock, yes, or even better: passive (no extra software) blocking via /etc/hosts, e.g. http://gaenserich.github.io/hostsblock/

other than that, try to get a better driver for that ooooold graphics card? or adjust the existing one? maybe there's some hardware accel setting which is disabled by default?


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#6 2015-12-06 16:10:15

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

ohnonot wrote:

would be influencing the webkit engine directly, which i think is possible but how...

Same question here. The way to customize surf is by playing with the source code, still webkit's flags could be a bit more accessible. Might open a wishlist item in the bug tracker.

better driver

My card should be supported by the binary-only legacy driver, unfortunately it is unavailable to Debian 8 Jessie, because ati dropped support. Jessie only has the open source driver, which apparently does not work well with an 11 yo card. I've seen stories of patching/installing the legacy driver on Jessie, but I'm not brave enough.

Thanks for hostsblock, I'll set it up.

Offline

#7 2015-12-06 17:01:04

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Poor performance in browsers when scrolling

domas wrote:

My card should be supported by the binary-only legacy driver, unfortunately it is unavailable to Debian 8 Jessie, because ati dropped support. Jessie only has the open source driver, which apparently does not work well with an 11 yo card. I've seen stories of patching/installing the legacy driver on Jessie, but I'm not brave enough.

that's a typical story for old hardware on new distros.
i had a similar situation a few years back, involving a SiS gpu (and nowadays, on a different machine, a SiS wireless card, vendor-locked in. bleargh!).
i had time on my hands and got some "better" driver eventually, it was heavy internet sleuthing.

Thanks for hostsblock, I'll set it up.

let us know how that goes!
i'd like to get some (positive) feedback - often when i bring it up people seem wary, and i don't understand why.


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#8 2015-12-07 15:39:04

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

ohnonot wrote:

i'd like to get some (positive) feedback

I've installed it from git using checkinstall on this script:

#!/bin/sh

install -Dm755 pkg/hostsblock-common.sh /usr/lib/hostsblock-common.sh
install -Dm755 pkg/hostsblock.sh /usr/sbin/hostsblock
install -Dm755 pkg/hostsblock-urlcheck.sh /usr/sbin/hostsblock-urlcheck
install -Dm644 pkg/black.list /etc/hostsblock/black.list
install -Dm644 pkg/white.list /etc/hostsblock/white.list
install -Dm644 pkg/hosts.head /etc/hostsblock/hosts.head
install -Dm644 pkg/hostsblock.conf /etc/hostsblock/hostsblock.conf
install -Dm644 man/hostsblock.8 /usr/share/man/man8/hostsblock.8
install -Dm644 man/hostsblock.conf.8 /usr/share/man/man8/hostsblock.conf.8
install -Dm644 man/hostsblock-urlcheck.8 \
  /usr/share/man/man8/hostsblock-urlcheck.8

You can tell there's been a lot of work put in to it. I'm using it at the moment without dns caching, we'll see how that goes.

I have notes. My old laptop takes about 2-3 minutes to run `sudo hostsblock` (not first run). During that time it is often using up 100% of the cpu. Looking at htop it's calls to sort, grep and sed that eat up cpu time. It would be very important to my comfort, if the script would throttle itself so as to not bring attention to itself when running in background.

Turning hostsblock on and off is as simple as copying `/etc/hostsblock/hosts.head` over `/etc/hosts`, while backing up `/etc/hosts`, though it would be nice if this were builtin. Use case is to check hosts' file's effect.

Hostsblock should copy over existing `/etc/hosts` to `/etc/hostsblock/hosts.head` automatically on first run. I forgot to do this at first, and it broke my dns resolution.

I hope I'm not being harsh. I enjoy hostsblock's features, thank you for the effort.

I also have a question, what's the purpose of serving blank html documents in place of the blocked resources?

Offline

#9 2015-12-07 15:48:10

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

To come back to the subject of scrolling in browsers, I've had partial success turning off certain WebkitGTK's settings in surf's source and recompiling it (like you do after most customizations).

Now if I scroll with hotkeys or by dragging the scroll bars, I enjoy _much_ more responsive action. It would be perfect, but unfortunately if I scroll with the touchpad (2 finger gesture), I still experience high latency and choppiness.

Due to the way my touchpad's drivers send in input, the smooth scrolling is non-artificial. The drivers actually report the tiniest movement. And that's a problem, it seems to be too much input for my old laptop in those modern browsers.

I'm now puzzling over how I could work around this. At the moment I refrain from scrolling with the touch pad. There should be a better solution.

Offline

#10 2015-12-07 18:34:48

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Poor performance in browsers when scrolling

domas wrote:

My old laptop takes about 2-3 minutes to run `sudo hostsblock` (not first run). During that time it is often using up 100% of the cpu.

this is normal. it checks to avoid duplicate entries, and building a file with 10s of thousands of lines simply takes some time.
imho, it doesn't make sense to run it much more often than maybe once a week.
i wrote myself a startup script for that.

domas wrote:

I've had partial success turning off certain WebkitGTK's settings in surf's source and recompiling it (like you do after most customizations).

congrats! if i ever use surf i'll make sure to ask you.


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#11 2015-12-08 21:23:46

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,401
Website

Re: Poor performance in browsers when scrolling

On iceweasel I have been using extension called "Scrollbar Anywhere", which will not improve the smoothness, but may improve the feeling a bit  (One can scroll with rmb-hold and mice movement).

My old laptop takes about 2-3 minutes to run `sudo hostsblock` (not first run). During that time it is often using up 100% of the cpu. Looking at htop it's calls to sort, grep and sed that eat up cpu time. It would be very important to my comfort, if the script would throttle itself so as to not bring attention to itself when running in background.

see man nice or https://en.wikipedia.org/wiki/Nice_%28Unix%29 .

Last edited by brontosaurusrex (2015-12-08 21:57:09)

Offline

#12 2015-12-09 12:20:46

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

brontosaurusrex wrote:

On iceweasel

I was surprised to find that iceweasel does not suffer from the same behaviour as the webkits. It somehow provides perfectly responsive scrolling when I disable smooth scrolling and hardware acceleration in its settings. It's a cpu and memory hog compared to surf for example, but still.

brontosaurusrex wrote:

see man nice

That's what I did. I'd like that I could throttle it so that it wouldn't heat up the processor so much, but at least now it doesn't compete with foreground processes.

Offline

#13 2015-12-10 07:28:29

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Poor performance in browsers when scrolling

domas wrote:

I was surprised to find that iceweasel does not suffer from the same behaviour as the webkits. ... compared to surf for example

surf is a very light and minimal frontend to the webkit engine, but it's still the webkit engine (proof: you still get all the developer tools when right-click => inspect element)
otoh surf is very light in that you practically don't have a gui, tabs in memory and what not.

i see you have a two-edged problem there.

maybe there are lightweight frontends for mozilla browsers?

or, more likely, you can tweak your iceweasel to not hog memory.
there's a few how-tos on "better performance for firefox" and such around the web, i think one was even mentioned here.


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#14 2015-12-10 13:08:56

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

I'm happy to say that after compiling surf's webkit2gtk branch, as opposed to the master branch which used webkitgtk version 1, it is running smoothly. Even without turning off all features like smooth scrolling etc smile I might still turn them off, for the sake of ascetism, but I'm happy I have a choice.

As an added bonus, the web inspector works, where as it used to crash surf, which is great.

Compiling the said branch wasn't straightforward, because as it turned out the version of webkit2gtk in debian stable was too old, so I had to use the one from stretch (testing). Helpful folk at irc.oftc.net #suckless figured this out for me.

Thanks for advice everyone.

Offline

#15 2015-12-10 21:03:49

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Poor performance in browsers when scrolling

domas wrote:

the version of webkit2gtk in debian stable was too old, so I had to use the one from stretch (testing)

Er...

You may want to read the "Don't Break BunsenLabs" link in my signature.

Adding testing/unstable sources to BunsenLabs is highly likely to wreck your system.

If you wish to use software from those repositories, follow this guide:
https://wiki.debian.org/SimpleBackportCreation


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#16 2015-12-11 09:41:21

domas
Member
Registered: 2015-12-02
Posts: 12

Re: Poor performance in browsers when scrolling

Head_on_a_Stick wrote:

Adding testing/unstable sources to BunsenLabs is highly likely to wreck your system.

Thanks for the link, inside I found another link to what looks like a simpler method. However, it is still unclear to me if there is an advantage to my current setup. My apt_preferences favour the stable release, and I only get testing when I specify it explicitly with apt-get. I'm only installing relatively isolated groups of packages from testing, like libwebkit2gtk and gtk+-2.0 in this case.

Anyway, if I compiled all those packages manually, like in those links, would my system be more stable than when I install them with `apt-get -t testing` (provided I don't let apt remove important packages). One drawback of the "manual" approach I can think of is that it is tedious to also repackage numerous dependencies of that package family (because usually numerous intervowen packages) (also webkit2gtk is almost 4gb). I am a newcomer to apt and debian packages, so some input would be appreciated.

Offline

#17 2015-12-11 21:29:08

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Poor performance in browsers when scrolling

domas wrote:

Anyway, if I compiled all those packages manually, like in those links, would my system be more stable than when I install them with `apt-get -t testing`

Yes.

Please read the Don't Break BunsenLabs link again -- what you are suggesting may still completely break your system as incompatible libraries can be brought in as dependencies of the targeted package.

Have a look through this thread:
http://forums.debian.net/viewtopic.php?&t=114130


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

Board footer

Powered by FluxBB