Re: Quickly drawing non-antialiased, discrete, pixels
Re: Quickly drawing non-antialiased, discrete, pixels
- Subject: Re: Quickly drawing non-antialiased, discrete, pixels
- From: Marco Scheurer <email@hidden>
- Date: Tue, 7 Jan 2003 13:10:41 +0100
On Tuesday, January 6 & 7, 2003, Dietmar Planitzer wrote:
Stroking 100.000 points takes approx. 1.2 seconds on my 450MHz G4.
[...]
b) Accumulating 400 points in the inner loop is faster than
accumulating
200.
Both changes together gain approx. 200ms.
Following Dietmar's benchmarks using NSBezierPath I went back to my
NSRectFillList test, and did what I was too lazy to do the first time:
stroke a limited number of rects at a time. The best result so far is
~0.65 seconds to draw 100 x 1000 pixels on a 400MHz PowerBook (versus
~5 seconds to draw 100,000 in one stroke).
- (void) drawRect:(NSRect) aRect
{
int numberOfRectsPerStroke = 1000;
int numberOfStrokes = RCOUNT / numberOfRectsPerStroke;
int i = 0;
NSTimeInterval startDate = [NSDate timeIntervalSinceReferenceDate];
for (i = 0; i < numberOfStrokes; i++) {
NSRectFillList (rects + i * numberOfRectsPerStroke,
numberOfRectsPerStroke);
}
NSLog (@"%.2f", [NSDate timeIntervalSinceReferenceDate] - startDate);
}
(remaining of the code unchanged.)
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.