Skip to content

A set of benchmarks that compares various aspects of type inference affecting compiler performance

Notifications You must be signed in to change notification settings

LucasVanDongen/SwiftTypeInferenceBenchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Type Inference Benchmarks

Whenever you want to use these benchmarks in original or modified form, you need to mention the original author (me, Lucas van Dongen) and link back to this repository.

A set of benchmarks that compares various aspects of type inference affecting compiler performance. Here are the results when ran on my machine (a 16" 2019 2,3 GHz 8-Core Intel Core i9 MacBook Pro). If you want to run the results for yourself skip towards the set up section

Strings and Numbers

Arrays

Dictionaries

Constructables

Computed Container

How to set up the benchmarks

First set up all of tools necessary to run the benchmarks:

  • Install at least one version of Xcode
  • Install Hyperfine
  • Install Python 3

How to run the benchmarks

Run python3 file_test.py in the Terminal from the SwiftBenchmarks folder.

Warning: BareComputedContainer can run very slow on your computer. If want to exluded it just edit file_test.py in any text editor and excluded it as follows:

    ...
    'LargeTypedMixedArray': ['LargeTypedMixedArray.swift'],
    'LargeInitMixedArray': ['LargeInitMixedArray.swift'],
    'TypedComputedContainer': ['BookingData.swift', 'TypedComputedContainer.swift'],
   # 'BareComputedContainer': ['BookingData.swift', 'BareComputedContainer.swift']#,
    'FunctionBareInit': ['FunctionData.swift', 'FunctionBareInit.swift'],
    'FunctionTypedInit': ['FunctionData.swift', 'FunctionTypedInit.swift']
}

About

A set of benchmarks that compares various aspects of type inference affecting compiler performance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published