Perf reminder: setting properties on Cocoa date/number formatters after initial setup defeats any attempt to get a speedup by caching them.
Conversation
what do you mean by "after initial setup"? There's no way to construct them already setup, is there?
1
that's exactly what I mean.
create
set
set
set
get x N
is fine
create
get
set
get
set
get
is slow
1
1
5
gotcha, makes sense, thanks! :)
1
NSImage is the same way. It's conceptually "create, setup, then consider immutable". I wish we had a way to formalize that.
2
3
“I wish we had a way to formalize that”: how about making the types immutable then? Force us to set them up at init time.
2
1
Replying to
It’d basically mean separating e.g. NSDateFormatter from NSDateFormatterSpecification, the former consuming latter.


