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


DCAT Export

<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:duv="http://www.w3.org/ns/duv#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:frapo="http://purl.org/cerif/frapo/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gsp="http://www.opengis.net/ont/geosparql#" xmlns:locn="http://www.w3.org/ns/locn#" xmlns:org="http://www.w3.org/ns/org#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:wdrs="http://www.w3.org/2007/05/powder-s#">
  <rdf:Description rdf:about="https://doi.org/10.5281/zenodo.3366380">
    <dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://doi.org/10.5281/zenodo.3366380</dct:identifier>
    <foaf:page rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
    <dct:creator>
      <rdf:Description>
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <foaf:name>Barik, Rajkishore</foaf:name>
        <foaf:givenName>Rajkishore</foaf:givenName>
        <foaf:familyName>Barik</foaf:familyName>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>Uber Technologies Inc.</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:creator>
      <rdf:Description>
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <foaf:name>Sridharan, Manu</foaf:name>
        <foaf:givenName>Manu</foaf:givenName>
        <foaf:familyName>Sridharan</foaf:familyName>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>University of California, Riverside</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:creator>
      <rdf:Description>
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <foaf:name>Ramanathan, Murali Krishna</foaf:name>
        <foaf:givenName>Murali Krishna</foaf:givenName>
        <foaf:familyName>Ramanathan</foaf:familyName>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>Uber Technologies Inc.</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:creator>
      <rdf:Description>
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <foaf:name>Chabbi, Murali</foaf:name>
        <foaf:givenName>Murali</foaf:givenName>
        <foaf:familyName>Chabbi</foaf:familyName>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>Uber Technologies Inc.</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:title>Optimization of Swift Protocols</dct:title>
    <dct:publisher>
      <foaf:Agent>
        <foaf:name>Zenodo</foaf:name>
      </foaf:Agent>
    </dct:publisher>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">2019</dct:issued>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2019-08-12</dct:issued>
    <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/ENG"/>
    <owl:sameAs rdf:resource="https://zenodo.org/record/3366380"/>
    <adms:identifier>
      <adms:Identifier>
        <skos:notation rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://zenodo.org/record/3366380</skos:notation>
        <adms:schemeAgency>url</adms:schemeAgency>
      </adms:Identifier>
    </adms:identifier>
    <dct:isVersionOf rdf:resource="https://doi.org/10.5281/zenodo.3366379"/>
    <dct:description>&lt;p&gt;Title:&amp;nbsp;Optimization of Swift Protocols&lt;/p&gt; &lt;p&gt;Abstract:&lt;/p&gt; &lt;p&gt;Swift, an increasingly-popular programming language, advocates the use of protocols, which define a set of required methods and properties for conforming types. &amp;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. &amp;nbsp;Unfortunately, heavy use of protocols can result in significant performance overhead. &amp;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.&lt;/p&gt; &lt;p&gt;In this paper, we describe three new optimizations and transformations we have developed to reduce the overhead of Swift protocols. &amp;nbsp;Within a procedure, we define LocalVar, a data-flow analysis and transformation to remove both dynamic dispatch and boxing overheads. &amp;nbsp;We also describe Param, which optimizes the case of protocol-typed method parameters using specialization. &amp;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. &amp;nbsp;We also describe how these optimizations work fruitfully together and with existing Swift optimizations to deliver further speedups.&lt;/p&gt; &lt;p&gt;We perform elaborate experimentation and demonstrate that our&amp;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.&lt;/p&gt;</dct:description>
    <dct:accessRights rdf:resource="http://publications.europa.eu/resource/authority/access-right/PUBLIC"/>
    <dct:accessRights>
      <dct:RightsStatement rdf:about="info:eu-repo/semantics/openAccess">
        <rdfs:label>Open Access</rdfs:label>
      </dct:RightsStatement>
    </dct:accessRights>
    <dct:license rdf:resource="https://creativecommons.org/licenses/by/4.0/legalcode"/>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>12968</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/benchmarks.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>109946489</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/binary.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>1363</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/README_BENCHMARK.md"/>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>3450</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/README.md"/>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>2908815</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/sampleapp.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>15743160</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/swift-4.2-app-evaluation.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>502947701</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/swift-master-08052019.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.3366380"/>
        <dcat:byteSize>681308229</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/3366380/files/swift-master-oopsla-submission.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
  </rdf:Description>
</rdf:RDF>
183
128
views
downloads
All versions This version
Views 18397
Downloads 12857
Data volume 15.8 GB8.4 GB
Unique views 16689
Unique downloads 3218

Share

Cite as