Monday, June 16, 2014

Well, let's see how bad 31 is for you

I'm going to release what I have so far and see what you think. I'm typing this blog entry in 31.0b1, so I guess you can consider that an improvement over last time. Localizers, strings are frozen, so you can start your engines (see the announcement in issue 42).

I still don't have profiling working in any meaningful sense, even though I can compile and run a gprof build successfully; it looks like gprof has a bug on OS X preventing it from generating timing information, so it might be worth a dive into gcrt0.o some weekend when Scarlet Johansson is not visiting. It does generate function call counts, though, so it does run. I still need to do some more experimentation on how to get some sort of runtime instrumentation operating again.

While doing some comparisons to see what else had changed between 29 and 31, based on your glowing reviews of 29, it appears there is a "bug" in 29 that I "fixed" in 31. In Fx26, I tried using our custom CoreGraphics backend for doing web page rendering, found it too slow and occasionally crashy, and set it to use Cairo as before. In 29, Mozilla changed the backend selection code; now content couldn't be anything but CoreGraphics. In 31, I discovered this, and "fixed" it to use Cairo. Not only does setting it to CoreGraphics work, though, it's now become incredibly faster by comparison. In fact, if you're on a very fast G5 like a quad, try this trick: go to a standard-definition YouTube WebM video, start it playing (wait for the comments to load), make sure your processor is set to Highest performance, and click Full screen. This quad G5 effortlessly scales a 16:9 SD WebM video to fill an entire 1920x1080 display. Only hardware can do that. That's some hot stuff. I like.

So that was most of the problem; the rest was tuning the GC a bit more, and something that cropped up on the G4 iBook/1.33 which may have something to do with this WebM regression people are reporting on G4s. For 29, Mozilla introduced off-main-thread composition, which as we discussed uses a background thread to receive screen updates. These updates are coalesced; OMTC won't bother displaying half-frames, even though it will show full frames as fast as it receives them. On the quad (and probably any dual CPU Power Mac), this is no problem because the thread runs on another CPU and the G5 generates plenty of frames plenty fast. On G3s and G4s with no power management, this is also no problem, because they don't power throttle and run at their max clock speed, and frankly any hardware assistance at all will be much smoother than the old method. The 1GHz iMac G4 and the 450MHz Sawtooth, for example, really like 31.

On laptops or uniprocessor desktops set for power management, however, the processor may be throttled or forced to clock slew, and OMTC will be starved for frames. We shouldn't be angry with Mozilla for doing this; it's unfortunate but logical given that virtually every Intel consumer chip in the last few years has been a multicore device.

One solution is to crank CPU performance up to Highest or at least Automatic, but this isn't much of a solution for a laptop running on battery. The other solution is to turn OMTC off (set layers.offmainthreadcomposition.enabled to false and restart the browser). Now, I don't like this solution much because it's totally unsustainable: Mozilla has made no secret that main-thread compositing will be removed as soon as the last platform supports it (Linux), and cool things like asynchronous pan-and-zoom require OMTC. Disabling OMTC will be supported on 31 for as long as the ESR lasts, but I predict main-thread compositing will be removed somewhere around Fx33 or Fx34 and then you'll have to deal with the additional CPU requirements; OMTC is such a fundamental change that I cannot realistically maintain the old rendering system.

If this makes a substantial difference to WebM or other responsiveness on the systems in this group, since it doesn't really affect the outlier systems, I'm willing to ship 31 with OMTC disabled (I'll need lots of good evidence that it helps, though -- something reproducible, not anecdotal reports). However, you can be sure that it will disappear in the very near future and this will be the last stable branch we ship this way unless Mozilla finds a critical problem with it.

The only other remaining issue is shortly after startup the app beachballs for around 30 seconds. I can't make this happen on a clean profile, so I suspect an add-on is causing it, but I can't figure out which one between the affected systems; it's possible a number of them behave this way. The browser only does it the one time, so it's more of a nuisance, but it would be nice to fix. If it does it for you as well, I'd appreciate you trying to isolate what seems to set it off (make sure that it doesn't occur with a clean profile first, though).

Remember to make sure the MTE and QTE are up to date, and to undo any custom GC settings changes before you upgrade (download, release notes). I have not decided if we will release on 31.0 or 31.1, but we'll see what you think. I have the flu, so I need to go to bed. See you in the morning.

21 comments:

  1. 31, first impressions:

    Tested on G4 PowerBook 1.33 GHz, processor is always set to "highest" (a few years ago I set the fans to kick in early and keep it at 52 °C or lower).

    - 30-second-stall after start-up: Confirmed. Full processor load and occasional spinning beachball. On my system, Adblock is the cause. If I disable it and leave all other extensions enabled, it's reliably fixed.

    - Webm performance: a slight improvement over 29, but not nearly as good as in 24. And even 24 was just good enough to play SD Youtube videos smoothly on the 1.3 GHz G4. If I disable OMTC, web.m performance is restored to 24-like. So, it's MacTubes after 31. Sad, but that's the way it is.

    - Keybindings are restored. Thanks (this drove me nuts in 29)!

    - Canvas animations work, so I can use my bank's two-factor authentication system again (a flickering bar graphics I scan with a device to produce a transaction number).

    Regressions:

    - heavy website take a lot longer to load in 31 compared to 29. I.e. Facebook newsfeed, Ebay start page and search results pages, YouTube start page all need about twice the time to finish loading. Switching off OMTC or Adblock, or using a fresh profile, doesn't make a difference.

    - typing accented characters in text fields using two keys in a row (e.g. é = [alt+e]+e for keyboards that don't have an é key) produces a second accent after the word. An naïve person named René is now naïve¨ René´. Password fields and the URL bar are also affected. Passwords generate an additional * for the entry, and typing www.münchen.de goes to different places in 29 and 31 resp. This is also critical because some people won't be able to log in to websites (and I won't be able to type international texts…). I didn't find a bug for this in Bugzilla.

    ReplyDelete
    Replies
    1. Mind you, scrolling performance and everything is perfectly okay and snappy, it's just page loading that somehow regressed.

      Delete
    2. Adblock Plus seems to be the culprit in my case, too. It causes a stall and pegs one CPU on a G4 MDD 1.25 GHz running OS X 10.5.8 for ~65 sec after the TenFourFox window appears on startup. The behavior is similar when I disable, then re-enable Adblock from the Add-ons Manager. Operations such as opening the Adblock Preferences or Filter Preferences cause a 10-15 sec stall. Deleting filters other than Adblock Warning Removal List and EasyList drops the stall to 35 sec. Disabling the two remaining filters drops the stall further to ~20 sec. Oddly, if I delete the two remaining filters, all of the original filters reappear in an enabled state the next time I either restart TenFourFox or disable/re-enable Adblock via the Add-ons Manager. Note that this last behavior is not unique to TFF 31.0b1; it also occurs in versions 24.6.0 and 29.0.

      Delete
  2. Thanks, Chris and rardin. I was thinking Adblock as well but only one of the affected test systems had it installed.

    Someone else reported Korean input did something similar. It looks like any Unicode/8-bit character trips up. This is our bug. I consider that a showstopper; it is issue 276.

    I'm toying with turning generational GC off also, since it has a CPU impact as well, and sticking with exact rooting GC for 31 (Mozilla allows this since B2G does not work with GGC yet). It won't be as aggressive about memory but it should have the improvements that 29 did at least and it may help page loads. Again, we wouldn't have a choice when they take this code out although incremental GC is still optional despite being shipped since at least Fx16.

    ReplyDelete
  3. After more web.m testing I have to say that also without OMTC, 24's performance isn't quite restored. I see this especially in videos with quick camera movement, they play much smoother in 24, even if I disable all performance killers in 31. So there must be still another cause of this regression.

    ReplyDelete
  4. I'm not seeing my bookmark toolbar items which I moved to the Nav bar in 29. I just get ">>" and when I click it it says "bookmark toolbar items". When I click that it opens up show all bookmarks window.

    ReplyDelete
  5. Finally got this working with my pre-29 profile. I use AdBlockEdge, not ABP so I have no issues there. ABE works with the ABP Element Hider so it's a good sub for ABP which has a memory leak anyway. I needed to update TabMix Plus and FTDeepDark (a theme I have). To FINALLY kill the navbar I installed Classic Theme Restorer which gives you the addon bar back and is what allowed me to kill the navbar. Unfortunately doing that also kills the keyboard shortcut to call up the popup url box, so I compromised and removed my google search box and replaced it with the url box.

    All other addons seem to be working fine without updates except All In One Sidebar. There is a workaround to force AIOS to work with Firefox 31, but as this is TenFourFox my result is that ever icon is horizontal and not vertical. I'm hoping that either a later T4Fx update or an AIOS update will fix this. Stylish works, Speed Dial works and the rest of the stuff I have on the AIOS toolbar I can work around. For me, I have successfully made the jump.

    ReplyDelete
  6. Make sure your Bookmark Toolbar is on. I had this too. Turning it back on solved it.

    ReplyDelete
  7. That's the point. I've put the bookmark toolbar ITEMS on the Nav bar, closed the bookmarks toolbar & now have one less toolbar hogging real estate. This doesn't work on TFF 31 but does on TFF 29 as well as Firefox on Linux & Intel os x. The problem seems that the url window does not resize in TFF 31.

    ReplyDelete
  8. After using the browser for a longer period on my PowerBooks (1.33 GHz G4 and 400 MHz G3), I'm now a bit suspicious that (at least) all extensions that display a button in the combined URL and add-on bar cause a performance hit. E.g. just clicking on the Browsizer button to display the resize menu will produce a spinning beachball occasionally which may last 20 seconds on the G4 (several minutes on the G3). I had to disable Adblock completely to even be able to use 31 on the G3. It's not just the stalls after startup, I get intermittent stalls as well on both PowerBooks when Adblock is active. I tried Adblock Edge, but I see the same problems there that rardin described for Adblock (i.e. beachball when switching between filter listst), as well as the stall after startup. I already mentioned slower page loading on heavy websites. I've seen none of these (JS related?) performance problems in 29.

    ReplyDelete
    Replies
    1. I'm going to turn off generational GC and return to 29's exact rooting GC for 31, since we're already somewhat off the reservation anyway.

      Delete
  9. I've tried it for light browsing, no downloads, and it's fine. This is on a G4 dual 1.42 GHz machine, running OS 10.4.11. Much faster than version 29.0 which was so slow I stopped using it after two tries.

    ReplyDelete
    Replies
    1. Interesting. For me it's exactly the other way around. I think we need more data points. It may just be that single core Macs don't like 31, but so few reports with so different browser and add-on configurations will probably be misleading. What about enabling about:telemetry for as many people as possible and collecting data?

      Delete
    2. I don't really have the infrastructure for that, and for certain kinds of observations that aren't reproducible I could only deal with the data in the aggregate.

      Delete
  10. Do you have an example website?

    ReplyDelete
  11. Confirmed. Right-click>Save as… works, but just left-clicking the link crashes the browser. Expected behavior is either playing (if possible) or downloading.

    ReplyDelete
  12. Set media.apple.mp3.enabled to false. I forgot to do that in the release build.

    ReplyDelete
  13. The newer releases (29 / 31) feel sooo sluggish and slow and this is a quad G5. I can't imagine a slower system. What is so frustrating about running anything with JavaScript is the browser only utilizes one processor and yet I have three other CPUs sitting idle. You would think MP systems are new but they've been in common use for over a decade.

    ReplyDelete
  14. 600 Mhz G3 iMac - I'm seeing the same as Chris's G3 PowerBook. noticeably slower than 24, including scrolling large pages..

    With AdBlock Plus I also get a > 1 minute beachball shortly after start-up and intermittent beachballs thereafter. The one-time welcome page for ABP also beachballs heavily every time you select one of the optional blocking options (e.g. social media buttons).

    ReplyDelete
  15. Hope your feeling better today. Get some rest over the weekend and maybe during the times of doing other things you'll get some ideas on how to resolve the problems.
    My friends in Slovakia love TFF and I include it with every G4 laptop I sell. Thank you. Joe

    ReplyDelete

Due to an increased frequency of spam, comments are now subject to moderation.