Re: Is it archiving/unarchiving NSBezierPath object to disk a performance issue?.
Re: Is it archiving/unarchiving NSBezierPath object to disk a performance issue?.
- Subject: Re: Is it archiving/unarchiving NSBezierPath object to disk a performance issue?.
- From: email@hidden
- Date: Mon, 18 Sep 2006 18:59:15 +1000
My senior told that archiving a
bezierpath
is a performance issue. is it TRUE?. He told me to create
bezierpath every
time in drawRect.
I'm not sure about the archiving issue itself... I can't see any
obvious reason why this would be bad, if NSBezierPath supports
NSCoding (I don't know off hand). It may do all sorts of magic
internally to cache things and whatnot, but ultimately the path is
just a series of drawing primitive commands, so I can't imagine why
archiving would be bad, or a performance issue. Still, as
NSBezierPath is more of a drawing mechanism than a storage mechanism,
it would probably be "nicer" in an aesthetic sense if you stored your
data in your own way (e.g. an NSArray of NSValue(NSPoints), for line
paths).
On the other hand, you definitely *shouldn't* recreate paths in
drawRect:, if you can avoid it. If the path doesn't change, store it
and reuse it for subsequent drawings. Constructing paths can
hypothetically be quite expensive (I've no idea what the real
performance is), so you want to do it as little as possible.
Redundancy makes Jack a slow computer.
Wade Tregaskis
ICQ: 40056898
AIM, Yahoo & Skype: wadetregaskis
MSN: email@hidden
iChat & email: email@hidden
Jabber: email@hidden
Google Talk: email@hidden
http://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden