There is a newer version of this record available.

Conference paper Open Access

Optimization of Swift Protocols

Barik, Rajkishore; Sridharan, Manu; Ramanathan, Murali Krishna; Chabbi, Murali


JSON Export

{
  "files": [
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/benchmarks.tar.gz"
      }, 
      "checksum": "md5:3413ddf24646f10ded189fe26f42afb8", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "benchmarks.tar.gz", 
      "type": "gz", 
      "size": 12968
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/binary.tar.gz"
      }, 
      "checksum": "md5:85277307ed42d98760602bc6ef1ead54", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "binary.tar.gz", 
      "type": "gz", 
      "size": 109946489
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/README_BENCHMARK.md"
      }, 
      "checksum": "md5:82b33342209bf37e3dd25b54478acc6e", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "README_BENCHMARK.md", 
      "type": "md", 
      "size": 1363
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/README.md"
      }, 
      "checksum": "md5:c7f31e37b6fc266cae3f23c65186f47b", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "README.md", 
      "type": "md", 
      "size": 3450
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/sampleapp.tar.gz"
      }, 
      "checksum": "md5:bafa7f271ab1ba462c9c78bfa1af6533", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "sampleapp.tar.gz", 
      "type": "gz", 
      "size": 2908815
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/swift-4.2-app-evaluation.tar.gz"
      }, 
      "checksum": "md5:89ece72568fa79beae2b7523028fea62", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "swift-4.2-app-evaluation.tar.gz", 
      "type": "gz", 
      "size": 15743160
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/swift-master-08052019.tar.gz"
      }, 
      "checksum": "md5:28a369e65291de02c54ccb81a112e105", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "swift-master-08052019.tar.gz", 
      "type": "gz", 
      "size": 502947701
    }, 
    {
      "links": {
        "self": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363/swift-master-oopsla-submission.tar.gz"
      }, 
      "checksum": "md5:acd9f279060a99579665a28e2920030b", 
      "bucket": "5375571b-c263-4f37-9d86-be6198c1f363", 
      "key": "swift-master-oopsla-submission.tar.gz", 
      "type": "gz", 
      "size": 681308229
    }
  ], 
  "owners": [
    74473
  ], 
  "doi": "10.5281/zenodo.3366380", 
  "stats": {
    "version_unique_downloads": 32.0, 
    "unique_views": 92.0, 
    "views": 100.0, 
    "version_views": 186.0, 
    "unique_downloads": 18.0, 
    "version_unique_views": 169.0, 
    "volume": 8398872462.0, 
    "version_downloads": 128.0, 
    "downloads": 57.0, 
    "version_volume": 15823317619.0
  }, 
  "links": {
    "doi": "https://doi.org/10.5281/zenodo.3366380", 
    "conceptdoi": "https://doi.org/10.5281/zenodo.3366379", 
    "bucket": "https://zenodo.org/api/files/5375571b-c263-4f37-9d86-be6198c1f363", 
    "conceptbadge": "https://zenodo.org/badge/doi/10.5281/zenodo.3366379.svg", 
    "html": "https://zenodo.org/record/3366380", 
    "latest_html": "https://zenodo.org/record/3370076", 
    "badge": "https://zenodo.org/badge/doi/10.5281/zenodo.3366380.svg", 
    "latest": "https://zenodo.org/api/records/3370076"
  }, 
  "conceptdoi": "10.5281/zenodo.3366379", 
  "created": "2019-08-12T23:45:46.407335+00:00", 
  "updated": "2020-01-20T16:51:03.337009+00:00", 
  "conceptrecid": "3366379", 
  "revision": 6, 
  "id": 3366380, 
  "metadata": {
    "access_right_category": "success", 
    "doi": "10.5281/zenodo.3366380", 
    "description": "<p>Title:&nbsp;Optimization of Swift Protocols</p>\n\n<p>Abstract:</p>\n\n<p>Swift, an increasingly-popular programming language, advocates the use of protocols, which define a set of required methods and properties for conforming types. &nbsp;Protocols are commonly used in Swift programs for abstracting away implementation details; e.g., in an industrial app, they are heavily used to enable mock objects for unit testing. &nbsp;Unfortunately, heavy use of protocols can result in significant performance overhead. &nbsp;Beyond the dynamic dispatch often associated with such a feature, Swift allows for both value and reference types to conform to a protocol, leading to significant boxing and unboxing overheads.</p>\n\n<p>In this paper, we describe three new optimizations and transformations we have developed to reduce the overhead of Swift protocols. &nbsp;Within a procedure, we define LocalVar, a data-flow analysis and transformation to remove both dynamic dispatch and boxing overheads. &nbsp;We also describe Param, which optimizes the case of protocol-typed method parameters using specialization. &nbsp;Finally, we describe SoleType, a transformation that injects casts when a global analysis (like type-hierarchy analysis) discovers some protocol variable must have some concrete type. &nbsp;We also describe how these optimizations work fruitfully together and with existing Swift optimizations to deliver further speedups.</p>\n\n<p>We perform elaborate experimentation and demonstrate that our&nbsp;optimizations deliver an average 1.56x speedup on a suite of Swift benchmarks that use protocols. Further, we applied the optimizations to a production iOS Swift application used by millions of customers daily. For a set of performance spans defined by the developers of the application, the optimized version showed speedups ranging from 6.9% to 55.49%. A version of our optimizations has been accepted as part of the official Swift compiler distribution.</p>", 
    "language": "eng", 
    "title": "Optimization of Swift Protocols", 
    "license": {
      "id": "CC-BY-4.0"
    }, 
    "relations": {
      "version": [
        {
          "count": 3, 
          "index": 0, 
          "parent": {
            "pid_type": "recid", 
            "pid_value": "3366379"
          }, 
          "is_last": false, 
          "last_child": {
            "pid_type": "recid", 
            "pid_value": "3370076"
          }
        }
      ]
    }, 
    "publication_date": "2019-08-12", 
    "creators": [
      {
        "affiliation": "Uber Technologies Inc.", 
        "name": "Barik, Rajkishore"
      }, 
      {
        "affiliation": "University of California, Riverside", 
        "name": "Sridharan, Manu"
      }, 
      {
        "affiliation": "Uber Technologies Inc.", 
        "name": "Ramanathan, Murali Krishna"
      }, 
      {
        "affiliation": "Uber Technologies Inc.", 
        "name": "Chabbi, Murali"
      }
    ], 
    "access_right": "open", 
    "resource_type": {
      "subtype": "conferencepaper", 
      "type": "publication", 
      "title": "Conference paper"
    }, 
    "related_identifiers": [
      {
        "scheme": "doi", 
        "identifier": "10.5281/zenodo.3366379", 
        "relation": "isVersionOf"
      }
    ]
  }
}
186
128
views
downloads
All versions This version
Views 186100
Downloads 12857
Data volume 15.8 GB8.4 GB
Unique views 16992
Unique downloads 3218

Share

Cite as