Warning: include_once() [function.include-once]: open_basedir restriction in effect. File(/mnt/gs02/herd03/29999/domains/naked.la/html/universal/siteheader.php) is not within the allowed path(s): (/nfs:/tmp:/usr/local:/etc/apache2/gs-bin) in /nfs/c02/h04/mnt/29999/domains/naked.la/html/emperor/wp-content/themes/emperor-theme/header.php on line 21

Warning: include_once(/mnt/gs02/herd03/29999/domains/naked.la/html/universal/siteheader.php) [function.include-once]: failed to open stream: Operation not permitted in /nfs/c02/h04/mnt/29999/domains/naked.la/html/emperor/wp-content/themes/emperor-theme/header.php on line 21

Warning: include_once() [function.include]: Failed opening '/mnt/gs02/herd03/29999/domains/naked.la/html/universal/siteheader.php' for inclusion (include_path='.:/usr/local/php-5.3.29/share/pear') in /nfs/c02/h04/mnt/29999/domains/naked.la/html/emperor/wp-content/themes/emperor-theme/header.php on line 21

posted February 12th, 2008

The Speed Edition continues. This release is more focused on bug fixes, but also features some speed ups and an unfortunate speed regression (one speedup is still too buggy to be used).

The Black Screen and Image Loading

Several people reported that opening images resulted in a black canvas. I have been unable to reproduce this problem, even on the same hardware, which as you may imagine, is a nightmare. The bug involves uploading images to the GPU. If this screws up, OpenGL creates a solid black texture.

However, the affect code had to be rewritten anyway, so there’s a good chance this bug has been fixed. If not, there’s significantly more robust error checking here and (finally) Naked light can send in bug reports, which should make this bug easier to catch.

For the good news, loading images is significantly faster. The actual transport from RAM to VRAM is literally about two orders of magnitude faster, which is absolutely ridiculous.

There’s just one major bottleneck left here, which is “cleansing” images into GPU-friendly data. Specifically, there’s errors with alpha premultiplication, but long story short, the speedup here has temporarily been turned off (as it was in Beta 2.0, too) so that you get a slower but more correct image in all instances.

Leopard Graphics Update

The Leopard Graphics Update that shipped yesterday has a disastrous bug in it. I’ve put together a small hack to work around this last night, and aside from that, the update’s great. The most notable difference is in the dock: without any code changes on my part, this is incredibly smooth and snappy at all times. Previously, I’d found the dock to be hit or miss: at random it would be slow and stuttery.

I don’t know the details of the Leopard Graphics Update, as Apple is characteristically vague about it:

About Leopard Graphics Update
Leopard Graphics Update is recommended for all users and improves the stability and compatibility of your Mac. This update requires Mac OS X 10.5.2.

I do know that it:

  • contains updated GPU drivers
  • contains updated OpenGL code, and
  • contains significantly updated raw image support, including the updates for Aperture 2.0.

So, there’s enough changes that I’m requiring this update. This Naked light release, and all future releases, require Mac OS X 10.5.2 and the Leopard Graphics Update.

Right now it rather uglily crashes without the update. Future versions will have a kinder warning.

Multi-threading

One of the most time-consuming parts of this update was involved in multi-threading more parts of Naked light. The rendering of individual documents now runs on their own thread, as does texture uploading. This introduces some nice speed increases, although not in the way you would think if you were a programmer.

Core Animation and Core Image aren’t very multi-threading friendly, despite what Apple’s marketing department would have you believe. Basically, Core Image has to render on the main thread, and Core Animation locks up the main thread while you’re rendering. So Naked light can’t take advantage of multiple processors here. (Although this wouldn’t be a huge win anyway as the GPU, not the CPU, is Naked light’s bottleneck when rendering.)

The speed ups here come from not having to switch OpenGL “contexts”—which are basically all the state information that OpenGL tracks to render scenes. Context switches are one of the slowest operations in OpenGL, and using a separate thread for each context let’s us avoid this. Another OpenGL bottleneck—changing the GLSL shader—is also avoided by doing this.

The other benefit of this is robustness. OpenGL contexts aren’t threadsafe, but Naked light has multiple threads that may need to access OpenGL for different reasons—generally for texture uploading. By putting each context on its own thread, I can upload textures on one thread and be rendering on another. This is another huge speedup win, but more importantly, simplifies the code and most likely stops a few crashers.

The One Speed Regression

One of the speedups introduced in Beta 2.0 was, for lack of an existing term, structure caching. Basically, Naked light would save the OpenGL shaders associated with the structure of your composition, which allowed you to make non-structural adjustments (like changing values in the Inspector) without having to recompile.

This is still incomplete, and the half-done version caused significant errors, typically with either the wrong image (or no image) showing up after a fairly short period of use. I’m hoping to get all the significant crashers and rendering bugs fixed by Beta 3.0, so anything that causes more errors needs to get turned off for the moment.

This is one of the most important speedups, and disabling it has slowed Naked light down a bit. When this is up and working for real, this is going to be the single most important speedup, so it’s next on the To-Do list.

Get it

Get it here: Naked light Beta 2.1.

Naked light Beta 2.1 requires OS X 10.5.2 and the Leopard Graphics Update.

3 Responses to “Beta 2.1”

  1. Hannes Says:

    The images get all messed up now already in quick look under library. The are disorted and , i dunno, messed up. running 10.5.2 on mbp.

  2. Pnutus Says:

    Great to see you’re putting a lot of effort in the development of Naked Light.

    I really like how you go in-depth on the changes in each version on the blog. Very interesting.

    Keep up the good work! :-)

  3. Brandon Says:

    Pnutus: Thanks!

    Hannes: If you could get my a screenshot (Cmd-Shift-3), that would be a great help. The images are perfect on my MacBook Pro. My email is brandon@naked.la

Leave a Reply