Swift Performance (JSON parsing, for example)


(Vanderlei Martinelli) #1

Hello.

This is not a request for change in the syntax and I don't if this is the
appropriate place, but for many Swift programmers experience and my own
experience, some things in Swift are very, very slow than Objective-C and
other languages. One of these things is parsing JSON data using
dictionaries/arrays (using Swift native types or NSDictionary, the result
is near the same).

You can read more info in articles like this one:
https://blog.sudeium.com/2014/12/10/swift-performance-too-slow-for-production/

Other thing: since I am talking indirectly of JSON parsing, there is some
expectation that it be handled natively on the Swift, with a suitable JSON
data format than just dictionary/array?

Regards,

-Van


(Joe Groff) #2

That particular article is almost a year old. We looked at this very workload and improved its performance significantly in Swift 1.2.

-Joe

···

On Feb 19, 2016, at 1:19 PM, Vanderlei Martinelli via swift-evolution <swift-evolution@swift.org> wrote:

Hello.

This is not a request for change in the syntax and I don't if this is the appropriate place, but for many Swift programmers experience and my own experience, some things in Swift are very, very slow than Objective-C and other languages. One of these things is parsing JSON data using dictionaries/arrays (using Swift native types or NSDictionary, the result is near the same).

You can read more info in articles like this one: https://blog.sudeium.com/2014/12/10/swift-performance-too-slow-for-production/


(Joe Groff) #3

See their followup here: https://blog.sudeium.com/2015/02/10/swift-1-dot-2-performance-pretty-much-fine/

-Joe

···

On Feb 19, 2016, at 1:22 PM, Joe Groff via swift-evolution <swift-evolution@swift.org> wrote:

On Feb 19, 2016, at 1:19 PM, Vanderlei Martinelli via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

Hello.

This is not a request for change in the syntax and I don't if this is the appropriate place, but for many Swift programmers experience and my own experience, some things in Swift are very, very slow than Objective-C and other languages. One of these things is parsing JSON data using dictionaries/arrays (using Swift native types or NSDictionary, the result is near the same).

You can read more info in articles like this one: https://blog.sudeium.com/2014/12/10/swift-performance-too-slow-for-production/

That particular article is almost a year old. We looked at this very workload and improved its performance significantly in Swift 1.2.


(Michael Gottesman) #4

Hello.

This is not a request for change in the syntax and I don't if this is the appropriate place, but for many Swift programmers experience and my own experience, some things in Swift are very, very slow than Objective-C and other languages. One of these things is parsing JSON data using dictionaries/arrays (using Swift native types or NSDictionary, the result is near the same).

You can read more info in articles like this one: https://blog.sudeium.com/2014/12/10/swift-performance-too-slow-for-production/

Other thing: since I am talking indirectly of JSON parsing, there is some expectation that it be handled natively on the Swift, with a suitable JSON data format than just dictionary/array?

If you find a specific test case that is slower than objective-c, please create a benchmark and contribute it via pull request. The benchmarks are located in ./swift/benchmark/

Michael

···

On Feb 19, 2016, at 1:19 PM, Vanderlei Martinelli via swift-evolution <swift-evolution@swift.org> wrote:

Regards,

-Van

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution