You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're seeing a pretty huge performance regression with Swift 5.2 on Linux and using JSONSerialization.jsonObject.
With Swift 5.1 we decode a 30MB Json file in approx 4s but that takes around 50s with Swift 5.2.
/tmp/json$ /data/swift-5.1-DEVELOPMENT-SNAPSHOT-2020-01-28-a-ubuntu16.04/usr/bin/swiftc -O json.swift
/tmp/json$ time ./json
real 0m4.389s
user 0m4.328s
sys 0m0.060s
/tmp/json$
/tmp/json$
/tmp/json$ swift --version
Swift version 5.2 (swift-5.2-RELEASE)
Target: x86_64-unknown-linux-gnu
/tmp/json$ swiftc -O json.swift
/tmp/json$ time ./json
real 0m50.944s
user 0m50.868s
sys 0m0.072s
It's definitely the JSON decoding, without that line the test completes in a few milliseconds.
While on the subject a 2017 MacBook Pro runs the same test (on Swift 5.2 or 5.1) in 0.4s. I know it's not an apples to apples comparison but the CPUs are in a similar class. The MBP is higher clocked but it's not close to explaining a 10x performance difference.
The text was updated successfully, but these errors were encountered:
Environment
Both tests conducted on the same Amazon EC2 g4dn.2xlarge instance within seconds of each other.
Additional Detail from JIRA
md5: 548b820a134ee2d1aff019be1e624774
Issue Description:
We're seeing a pretty huge performance regression with Swift 5.2 on Linux and using JSONSerialization.jsonObject.
With Swift 5.1 we decode a 30MB Json file in approx 4s but that takes around 50s with Swift 5.2.
Test code is as follows:
The test json file is available at https://gist.github.com/kuwerty/56a3ab1427bffe6a346a640b77ef486b
It's been gzipped and then base64 encoded for github, the following should get it back:
cat foo.json.gz.base64 | base64 -d | gunzip >foo.json
It's definitely the JSON decoding, without that line the test completes in a few milliseconds.
While on the subject a 2017 MacBook Pro runs the same test (on Swift 5.2 or 5.1) in 0.4s. I know it's not an apples to apples comparison but the CPUs are in a similar class. The MBP is higher clocked but it's not close to explaining a 10x performance difference.
The text was updated successfully, but these errors were encountered: