• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quickly drawing non-antialiased, discrete, pixels
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Quickly drawing non-antialiased, discrete, pixels (From: Dietmar Planitzer <email@hidden>)

  • Prev by Date: Re: Converting OSX Path to a OS9 Path
  • Next by Date: Convert hexadecimal NSString (0xff00) to decimal integer?
  • Previous by thread: Re: Quickly drawing non-antialiased, discrete, pixels
  • Next by thread: Re: Quickly drawing non-antialiased, discrete, pixels
  • Index(es):
    • Date
    • Thread