Wednesday, 2 July 2008

Gecko is getting worse?!

First let me start with a simple statement: I wrote this post from Midori web-browser. If you'd like to guess why, read on.

I didn't want to write this particular post so soon, but I just couldn't hold it any more. In four hours of doing random stuff on computer, gecko managed to anger me to the point I just couldn't go to sleep before writing a rant about it.

First it started with Firefox only, now it's happening to Epiphany, too. Gecko is eating my CPU. I cannot explain why, I cannot tell when, because it's totally random. Just out of the blue, my laptop starts to be dreadfully slow, and until I kill epiphany, it stay such (well, I have never had the patience to wait more than 2 or 3 minutes, so in longer time it might fix itself).

Why ranting about it today? Because it happened twice and both when I was doing my favourite stuff. First I was sketching some echo icons (I'll perhaps write a post about those tomorrow) and suddenly inkscape started to be so slow that it was literally unusable. I wondered what happened to it, and after about 2 minutes I finally fired up system monitor to see if there is anything to see - and there was! Epiphany, which was on the background, on a different virtual desktop, was sucking up CPU. I killed it (I kill epiphany instead of closing it to keep my session saved) and inkscape immediately stared to behave normally.

Next, I was watching some series and in one of interesting scenes the video started playing so slowly that it was pretty quickly out of sync with audio. I went WHOA? My CPU should handle that well. So I paused the playing, got out of the fullscreen view and looked what was happening. Again, CPU was 100% used! While doing nothing! This time I fired up new tab in terminal and killed epiphany. CPU use immediately droped to 0% and I could watch the rest of the episode.

Why I rant about gecko and not epiphany? The reasons are simple - when xulrunner in Fedora was still 1.9b5, this thing happened to firefox. Quite cassualy. But epiphany was fine. BUT. After update to 1.9 final (and waiting for epiphany rebuild, because the mozilla guys again change something so that most xulrunner apps started crashing) epiphany started to suffer from this issue as well. I can only ask: what are you guys at mozilla doing? Preparing for next release? Putting random infinite loops to gecko code, so that you can remove some of them in next release and say it's faster and more efficient? Gah.

Anyway, don't take the last few senteces seriously, it's over too much exagerated what might be the worst case scenairo behaind the curtains ;-)

And why do I not file a bug against it?

  • I am lazy

  • Someone probably have done it already

  • I'd rather spent my time debuging webkit than gecko

  • I have better things to do than trying to figure out some random, hard to reproduce bug in gecko

  • If I go crazy, I can use epiphany with webkit backend - even though it lacks some features I use, it works



And yeah, you might ask, isn't it a result of me having 50+ opened tabs assorted into 4 windows? My answer would be - old gecko handled it well, webkit handles it even better than that, why gecko 1.9 cannot?

And one random rant for the end: is it just me, or does firefox/gecko does not remember me being logged in here on the blog? It behaves like I am not logged, when I click log in, it quickly discovers I am already logged, but when I go back to my blog homepage it still thinks I am not logged in. WebKit does not suffer this issue, which makes my blog managing easier to do in webkit based browsers...

Update 1: On suggestion from Kevin Kofler, I hereby thank all the people involved in KHTML, WebKit, WebKit gtk port and epiphany for they hard work towards perfect *nix web-browser engine and lightwieght native-gtk web-browser :-) Well, I could also include konqueror folks, but for some reason I don't like it's UI...

15 comments:

Anonymous said...

that was interesting to have all these benchmarks showing that Gecko needs less RAM that competitor and that it's fast at rendering JavaScript.
It would have been nice to have similar benchmarks for CPU utilisation and time needed to start the browser.

Because at present we don't see the whole picture.

I still can't figure why Gecko is so slow to launch (Firefox or Epiphany)

I can't wait to see several browsers using GTK+Webkit to choose the best...

Unknown said...

Is your system completely up to date? I was having a terrible time with firefox 3.0 beta because of the bug with sqlite that would cause massive ammounts of IO with the filesystem, so much so that I got quite angry and almost punched a whole in the wall. But, since 3.0 was released, that problem has gone away, and it has been extremely resource friendly. No more complaints here.

toto said...

thanks for reporting the issue, but I really don't understand why you don't want to fill in a bug report.

I've read your motivations, but they all look a bit stupid from my point of view. If you want to have things going better and better you also have "to waste" some times in reporting bugs. Complains alone aren't enough!

Julio Merino said...

I've noticed similar "random" problems here with Fedora 9 x86_64.

Do you have Adobe Reader installed? I think the slowdowns are caused by this application when it is launched embedded into the browser, but only some times.

Check if, when the computer is slow, you have a ld-linux.so.2 process sucking your CPU. I bet this is launched for the x86_64->i386 compatibility so that the 32-bit Adobe Reader plugin works inside 64-bit Gecko and, for some reason, it gets stalled.

(Maybe the problem also exists in native i386 installations, though, so check the above even if you are not running x86_64.)

Martin said...

jesse: Yup, up-to-date, with updates-testing enabled. The IO issue in firefox 3 beta 5 was even worse than this issue I'm having, but didn't affected epiphany.

Martin said...

toto: yeah, the motivations are stupid, but I wasn't in a mood to write something better. I'll consider filling the bug, but since gecko and firefox and more and more dissapointing to me (for me Firefox 3 is the worst firefox ever, feature-wise) while webkit is gaining my trust, I really lean towards helping with webkit gtk port rather than endlessly trying to help with non-*nix application that seems to be oriented more and more on windows users...

Martin said...

julio: I am on i386 machine and I don't use adobe reader (evince is good enough for me). Actually, I don't use any closed source software on my Fedora...

The ld-linux.so.2 does not seem to be the trigger to this issue for me.

pbrobinson said...

What about extensions? I found that flash does that to me on occasion. It looks like its firefox but if you go through an close of pages with flash on it the problem will probably go away.

Kevin Kofler said...

Don't forget to thank the KDE team for having developed a viable alternative to that CPU hog. ;-)

(No, WebKit is not all Apple's work...)

Martin said...

peter: yep, swfdec indeed seems to be able to trigger simillar issue, but not if it's in paused mode - which is the default one.

Martin said...

kevin: Ahh, yes, KHTML rulezz (but I don't like konqueror UI) :-) If only KHTML and WebKit guys joined the forces, now that WebKit was opensourced. I'd be in seventh heaven ;-)

Anonymous said...

Folks, I just finished my little and silly testing of FF3 and found something interesting.

As Martin, I (and my sister at her Windoze) discovered dreadful slowdowns issued by FF3.

There is no any visible dependencies between these slowdowns (on all my Fedora 9 and Mac OS X boxes) and some event except one - FF3 frequently freezes at its startup.

My lovely feature of FF is a rss-feeds. I prefer sibscribing to them instead of reading web-sites in a "traditional" way.

I remembered that when I've got a weak internet connection (ca 64 kbit/s) this was a disaster, then I started my FF - it starts updating all rss-feeds starting a thread (I'm not familiar with FF internals) to each rss-subscription. Network IO was enormously high, and netstat shows hundreds (nearly 400-600) of opened network connections. Thankfully those times has one.

With FF3 the issue is returned (at least issue with similar sympthomes), an I decided to check whether it can be related to RSS-updates.

I yield to the advice of Matej Cepl and moved places.sqlite (and all bookmarks-related files I found) into backup dir and started FF3 w/o any bookmarks (rss-feeds).

...

After ~1 hour of web-surfing I didn't encounter any slowdowns. Period.

Seems that there is something changed dramatically in the rss-updating algorithm.


For thse who intersted, I'm providing my current bookmarks-file

http://peter.fedorapeople.org/bookmarks.html

It doesn't contains any pr0n-links and accounting info so its pretty uninteresting :)

But you may found it useful to test my results. I'm curious too.

// captcha ymqfisfk

Anonymous said...

Some add-ons to my previous reply:

* No, It doesn't affect by any ff-addons.
* Seems that rss-updates are made simultaneously but in a randomly chosen time (I dont find any system so far, and I'm not familiar with black magic of Gecko internals).
* No, I haven't installed Adobe bloatware, unnecessary plugins for flash-games and videos (at least on majority of my computers).
* Yes, this issue was discovered not only on my Fedora, but on Wondoze, Mac OS X and so on. Some of my friends observed the same behavior of FF3.

// captcha cvklc

Andri said...

peter, this should be the bug
It's like you can't use RSS with Firefox 3, while it worked perfectly before. I'm playing with Opera now, since before 3.1 we can't expect any fix

Anonymous said...

OMG! 2-years old bug!