I for one would not be changing my approach based on this post. I might start doing some disassembly if I was writing performance sensitive production code in Swift, but that would be about it.
Swift Performance: Too Slow for Production
11–17 of 17 posts
Re: Swift Performance: Too Slow for Production
#12Re: Swift Performance: Too Slow for Production
#13I haven't tried Swift yet, so I'm posting this just to know what other experiences people have.
Re: Swift Performance: Too Slow for Production
#14Even as Python programmer I find the boast "2.6x faster than Objective-C and 8.4x faster than Python 2.7" pretty bizarre. So Objective-C is a statically typed, compiled, C superset and still only 3.5x faster than Python? That is not really something to be proud of.
I believe Smalltalk is as about as much of an influence as C.
Lots of Objective-C programmers actively dislike Swift because it's so static.
Re: Swift Performance: Too Slow for Production
#15The initial Swift version the author created uses a third party library for wrapping the JSON decoding and that library appears to create a metric shit ton (technical term) of short lived objects whilst performing its magic. I cobbled together a less memory insane version (likely similar to the one described as Obj-C in Swift - although I disagree with that description) which is an order of magnitude faster. Finally there is an Objective-C version which is an order of magnitude faster again. All tests were running on an iPhone 5s in release mode.
Decoding JSON is an annoying task for most languages. That Swift decodes half a megabyte of JSON in a tenth of a second is a reasonable trade off, for me, when comparing it to the verbosity and occasional fiddlyness of working with Obj-C. It was quite nice to see how simple it was to mix Swift and Obj-C as I was creating this, so that suggests little downside to using Swift for the mundane tasks and coding specific bits in Obj-C when that's necessary for speed reasons - although Obj-C is not uniformly faster than Swift as noted in other articles.
Re: Swift Performance: Too Slow for Production
#16I'm currently deciding whether to start a project in Swift or Objective-C, I know very little about either, for learning purposes Objective C has the edge but I don't want to invest time learning something that's on its way out.
I doubt Objective C is on its way out...
A lot of experienced Apple developers do not expect Apple to support two languages for a long time. With all the noise Apple made about Swift, it will be getting more TLC than Obj-C and eventually, Obj-C will not be supported anymore.
We're not talking about a few years, we're talking maybe Carbon>Cocoa style, 5 years before Apple starts warning devs that Obj-C would be phased out in several years.
Re: Swift Performance: Too Slow for Production
#17Swift hasn't even been out for a year. Look at the progress it made since summer, it sped up a lot in certain parts.
Just file a radar on what's slow and they'll fix it.
Apple intentionally is shipping Swift as is to get devs ready and start planning for the next five years.