Live data from Hacker News

Swift Performance: Too Slow for Production

blog.sudeium.com

1–10 of 17 posts

Re: Swift Performance: Too Slow for Production

#5

I'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...

Re: Swift Performance: Too Slow for Production

#6
post #5

I'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...

It's an easy decision then.

Re: Swift Performance: Too Slow for Production

#8
post #3

Here's a different comparison for what it's worth http://www.jessesquires.com/apples-to-apples-part-two/

The point is that author of original post was unable to get it compile with optimization turned on because of internal compiler errors. So yep, Swift can be faster but so far you must be lucky enough to get it compiled.

So... Main conclusion is that Swift is not production ready yet.

Re: Swift Performance: Too Slow for Production

#9
Cough When it comes to describing languages, there's a set of words you should just consider vacuous throat-clearing until proved otherwise. This includes "fast", "powerful", "robust", "easy to [pretty much anything]", "featureful", and a few others. Why is this? It isn't because it's impossible for any of these things to be true; all of them have been true of some language somewhere, even on initial release. It's because every language always claims it.

Also, "fast as C" is a slippery little thing; anything can be fast as C on some benchmark with an optimization for that benchmark, being reliably as fast as C and being able to engineer in the confidence that something is as "fast as C" all the time is quite another. Witness the number of people who will vigorously claim that Javascript implementations are "as fast as C", despite in reality not being anywhere near that except in the aforementioned carefully-engineered benchmarks. Especially beware of "adding integers in an array". That's easy to optimize and nowadays says little since everyone optimizes for that case, knowing it's going to be benchmarked.

In other news, the latest web framework is "easy to use" and "powerful" and probably "MVC". This is just throat clearing, not a description anymore, because nearly everything is "easy to use" and "powerful" and "MVC". Also, half the libraries posted to /r/$LANGUAGE are "A simple, powerful library for X", which probably translates to "A library I spent about 4 hours on" rather than any sort of increased probability of it being either simple or powerful.

Re: Swift Performance: Too Slow for Production

#10

Why not profile and see where the time is actually going? Slow JSON parsing? Slow I/O?

Blog author here. I actually did: the vast majority of time is spent in the Swift Runtime. The JSON parsing is via NSJSONSerialization, which is an Apple library written in Objective-C, and it's fast. I'm not measuring IO, I'm only measuring the time spent turning the NSDictionary objects that come back from NSJSONSerialization into my model objects.

I didn't spend a huge amount of time profiling this though, since it's very early days in my project and it'd take me less time to just rewrite what I'd done so far in a language that I know works.

Post reply on HN