XScreenSaver 5.00b4

XScreenSaver 5.00b4 out now.

  • Should be somewhat faster than 5.00b3.
  • All the savers should work properly on both PPC and Intel Macs.

Please let me know if you find either of those to not be the case.

See todo.

I think this is getting really close to being called a non-beta release, since at this point I'm not sure I'm not sure I'm going to be able to make any further headway on performance. I'm pretty much out of ideas on that front, short of "throw away most of the work I've done so far, and re-implement Xlib in terms of OpenGL instead of in terms of Quartz". Which, as you may imagine, I'm not particularly eager to do.

The reason it works on Intel Macs is that Apple finally replaced my busted iMac, and the replacement is an Intel Core Duo. And it is OMG fast! Seriously, it seems like compilations are around 2.5× faster than before, and all the screen savers run way faster too (so there goes any hope of having decent xscreensaver performance on slow machines, since I won't even be able to tell there's a problem any more...)

The one exception to this speed-up is, of course, Photoshop. Photoshop is a fucking dog, since Adobe still hasn't released an Intel build of CS2, meaning it runs in the PPC emulator. It feels like it's running at 75% to 50% of the speed it ran on my PPC iMac, and it uses a truly gargantuan amount of memory. Like, after editing a dozen pictures, closing them all, and hiding Photoshop, minutes later it was still consuming 6% CPU and almost 1.5 GB RAM.

So if you use Photoshop more than XCode or other Apple-provided software, I'd say stay the hell away from the Intel machines until Adobe gets their shit together.

Tags: , , , , ,

23 Responses:

  1. jeremiahblatz says:

    So if you use Photoshop more than XCode or other Apple-provided software, I'd say stay the hell away from the Intel machines until Adobe gets their shit together.

    The exception to this is if you have a crappy G$, say 1GHz or slower. Photoshop on my MacBookPro (2GHz) is significantly faster than it was on my G4 867.

    • cje says:

      I have a friend who has a G4 tower (circa 2004) and he gave me an 80mb .psd file to test on the MacBook we've got at work.

      Holy Crap! The performance increase was incredible. Three seconds for Photoshop to launch, another couple to open the file. I then fucked around with the image for a few minutes (adding layers, changing colors, placing elements, and so on) without saving. Then I hit "revert" and it took less than 5 seconds before I was back to the original file. On his old machine, my friend could have gone for coffee while waiting for the file to revert, and returned hoping Photoshop hadn't crashed.

    • jwz says:

      Sure, if you're replacing a two year old machine. But today you can spend your money on an Intel, or on a PPC. If you spend your day in Photoshop, you will get literally twice as much for your money if you go PPC instead of Intel.

  2. ahruman says:

    Photoshop is a fucking dog, since Adobe still hasn't released an Intel build of CS2.

    Not going to happen, because they don't have one. Apparently Adobe's SCM doesn't support tags...

    As for your Todo list:

    1. Your guess is as good as mine. Well, nearly as good. Hard to track down without actually fiddling with the source.
    2. Most of Cocoa does sane stuff when given nil values. Containers are the exception; since NSUserDefaults wraps an NSMutableDictionary, it too is non-sane. Instead of setting a prefs value to nil, you have to remove it. Unfortunately, text fields helpfully give you nil values instead of @"" if they're empty. Some extra logic is needed.
    3. Assertion failures ought to abort... weird. Is this asserts() in your code, or Cocoa's exceptions (which are used like asserts)? It could be something to do with full-screen handling in ScreenSaverEngine.
    4. No, but you can use CFShow() instead of NSLog() and stick on whatever prefix you want. I mostly use __PRETTY_FUNCTION__, __LINE__.
    5. Subclass the relevant control and store the old values in prefs.
    6. Don't show a path, show the folder name (preferably with icon) and a Select button.
    7. For double-buffered graphics, use OpenGL for the copy. Really. This sample code demonstrates the fast path for this. For single-buffering, you can get a full-screen unbuffered context using QuickDraw, but it's deprecated, evil, and I don't really want to dig back and work out how to do it.
    8. Sounds like a bugger.

    • ahruman says:

      Oh, alternative for number six: [[textField cell] setLineBreakMode:NSLineBreakByTruncatingHead];... but doing it right is still a better idea. :-)

    • jwz says:

      2: I'm afraid "some extra logic is needed" doesn't tell me anything; I don't see what I can do about this.

      3: I meant NSAssert(), which seems to turn into a Cocoa exception. And now that I think about it, it's possible that I've only seen this happen in my SaverTester framework and not in the actual ScreenSaverEngine, so maybe it's not really a problem. I'll test some more.

      6: Is there some simple way to do that, or am I expected to roll my own?

      7: I know that OpenGL manages to do things fast; but right now, I've got this gigantic pile of Quartz code that goes in through CGContextRef. I am not eager to rewrite all that code in OpenGL. Unless there's some way to do GLish things in a Quartz context, I think "use OpenGL for the copy" amounts to "throw away all your code and start over".

      • ahruman says:

        2: at some point, you're getting the value from an NSTextField, and that value is nil; you're then setting a preference value to that value. You need to either check for nil when retreiving the value from the text field, and replace it with @"", or check for nil when setting the preference value, and using -removeObjectForKey: instead of -setObject:forKey:. Since both steps are presumably happening in the same place, it shouldn't be a big thing.

        3: NSAssert() behaviour is customisable; the default is to raise a NSInternalInconsistencyException, and if you don't have any exception handlers the default one in the event loop will log a message and then try to continue, possibly leaving you in a confused state.

        6: not a hugely simple way... having actually looked now, you're not far off anyway. As I mentioned in a followup, there's a simple way to get the truncation behaviour you want. If you do want to use an icon, get the IconFamily class (MIT/X11 license), and use the handy +iconFamilyWithIconOfFile: and -imageWithAllReps: methods to get an NSImage to pass to an image view. If I were a perfectionist, I'd suggest that this image view should be able to revieve drags... good thing I'm not, eh? :-)

        7: I can appreciate that. However, you should be aware that using OpenGL to transfer the pixels from a CGBitmapContext to screen wouldn't necessitate changing any of the drawing code; it's basically the modern-day equivalent of using hardware-specific page flipping. Mmm, page flipping... I'm not saying it needs to be top priority or anything.

        Some bugs and niggles:

        • The OK buttons in config dialogs are too small. I know it sounds like an extreme nitpick, but it stands out like a sore thumb to someone who's really used to Mac OS. The correct width for OK and Cancel buttons is 68 pixels (Human Interface Guidelines: Controls: Buttons: Push Button Specifications).
        • OK buttons should be bound to return, and Cancel buttons to escape. [okButton setKeyEquivalent:@"\r"]; [cancelButton setKeyEquivalent:@"\e"];
        • The Forest screen saver doesn't show up because there's a system-installed screen saver of that name. (Why they're uniqued by name is a tad unclear.) There's also a third-party Gears screen saver, which caused the xss version not to show up here.
        • BSOD crashes (how appropriate) if it's set to only show the wossname X terminal, or all modes are disabled.

        • jwz says:

          That's the thing though, I'm not getting a nil value from NSTextField: I've just hooked that text field up to NSUserDefaultsController with 'bind', and the error is happening somewhere down in the bowels of that interaction, far away from my code.

          • ahruman says:

            Hmm. That sounds clearly buggy. *Pokes around a bit*

            You can filter bindings using value converters. Lemme see how to do that programatically... *pokes* Value Transformers Programming Guide.

            Hmm. When setting up bindings you can specify options... NSAllowsNullArgumentBindingOption and NSInsertsNullPlaceholderBindingOption + NSNullPlaceholderBindingOption may be relevant. Or not. I'm not really into bindings.

  3. unuselessj says:

    According to The Inquirer today, it will be almost another year for native Adobe apps to come about.

    Adobe actually has a new feature when running PS CS2 in the PPC emulation mode. "Windows-like memory allocation"

  4. cje says:

    You say, ". . .I don't use any Microsoft products and neither should you."

    Does this mean you found a better keyboard? If so, please tell me what it is so I can recommend it to others!

    • kfringe says:

      Belkin Ergoboard.

      The new naturals are for shit.

    • jwz says:

      Kinesis Evolution, chair mount. Been using it for years, it's the only way to fly. Pictured here.

      • gregv says:

        Mine turned five last month. Got it because of your gruntle and totally agree. They're updating the design now and "will have more information" this quarter, which I hope translates into "will be available this year." It's getting more and more flaky and I was dreading paying another arm and a leg for the exact same thing. (Serial mouse and the giant keyboard connector with adapters to PS2? Come on!)

        • jwz says:

          I'll bet their "updated design" includes "chair-mount no longer available", given how much they were hyping the rail-mount as being the better way.

  5. kfringe says:

    It must have been the week for getting new iMacs. Maybe there was something in the water.

  6. 4zumanga says:

    Just one question. Is it possible to install all the screensavers at once? When I double click on one it says "Do you want to install this", and if I try to open a bunch at once, only one seems to get installed.

    • duskwuff says:

      Copy them all to $HOME/Library/Screen Savers. The double-click issue is an Apple bug and should be reported as such - you can do so at https://bugreport.apple.com/ if you have an ADC account (free).

    • jwz says:

      There is a README that explains this.

      If someone wants to write me an "installer" AppleScript or something, that'd be nice. I tried, and it was hard enough to do the "cancel/replace all" dialog that I decided it wasn't worth the effort.

  7. natenate says:

    There is a new "bug" in beta 4. Seems to affect all of the savers. When the screen saver is initialized, the display blanks normally, then quickly inverts to a white screen, and then back to black as the screen saver starts. Rather annoying, and not present even back to the v4 alphas.

    OS X 10.4.6 PPC, Millions of Colors.

    • another_old_guy says:

      I'm getting the same thing. Wild guess-- the back buffer isn't being cleared before the first time it's displayed.

  8. alierak says:

    There's another occurrence of FD_ZERO in hacks/fontglide.c that will break (__ERROR_use_memset_not_bzero_in_xscreensaver__) on BSD or Darwin. Same workaround as in sonar should do.

  9. ewindisch says:

    My experience, unfortunately has been with a 1.4ghz G4 and a 1.5ghz Core Solo.. as you can imagine, the G4 kicks the Solo's ass. The G4 has better video and the machines have fairly similarly matched cpus, but the G4 doesn't need any PPC emulation... Heck, even the Intel-compiled apps seem slow -- not too surprising, really.

    I'm sure that the Core Duo is nicer than the Solo.. but surely, the Solo is a waste of money.