Re: Speed of Quartz (was: optimizing compilers)
Re: Speed of Quartz (was: optimizing compilers)
- Subject: Re: Speed of Quartz (was: optimizing compilers)
- From: email@hidden
- Date: Mon, 4 Feb 2002 12:01:38 -0800
Here are two simple NSView subclasses. Both draw connected line
segments
with 500 points using NSBezierPath -moveToPoint: and -lineToPoint:. A
reasonable expectation is that the first implementation is faster than
the
second implementation. The first implementation avoids 500 allocations
and
lots of attribute setting operations. If fact, the first
implementation is
more than ten times SLOWER than the second implementation.
NSBezierPath is
seriously broken.
Interesting. The question is, is this NSBezierPath's fault, or
Quartz's? Or is this even considered correct behavior for some reason?
Certainly the rendering generated by the two methods is not
identical. Drawing each line separately avoids doing line joins, of
course. Additionally, I would suspect that the renderings will differ
whereever two line segments cross each other, but I haven't tried this
to confirm.
I think we're getting to the point where it would be nice to hear what
a Quartz engineer has to say about all this! :->
Ben Haller
Stick Software