[cairo] JIT for pixman

Soeren Sandmann sandmann at daimi.au.dk
Sat Jan 10 08:18:36 PST 2009


Bobby Salazar <bobby8934 at inbox.com> writes:

> Could someone please explain the benefits of JIT for pixman? I seen
> a lot of talk about the best ways to approach JIT for pixman, but I
> so far haven't been able to figure out what the benefits are? Does
> it yield faster code/better performance for pixman, or easier
> maintainability?

A JIT compiler can potentially yield both better performance and
better maintainability.

There are a lot of combinations of formats and operators. It is true
that only relatively few of them show up in any given app/environment,
and we do have reasonably optimized versions of many common ones.

But it is still possible to do a lot better. At the moment anything
involving transformations or filters hits the slow path. Anything
involving formats other than a8, argb32 and rgb16 hits the slow
path. Anything involving operators outside OVER, IN, and ADD are hits
the slow path.

It is not going to be possible to cover all those combinations with
handwritten fast paths, especially considering that there are plans to
add more operators and that correct color management will require more
image formats.

Also, there is a ton of SIMD instruction sets. Just for x86 the
currently available ones are: MMX, 3DNow!, SSE, SSE2, SSE3, SSE4,
SSE4.1, and SSE4.2. The announced ones are SSE5, AVX, and
Larrabee. There is also Altivec for PowerPC, and I believe two
different ones for ARM.

Putting all of these instruction sets to use without a JIT compiler is
essentially impossible.


Soren


More information about the cairo mailing list