https://github.com/johennes/swift-performance-playground
Swift Playground for visualizing algorithm time complexity
https://github.com/johennes/swift-performance-playground
performance-measurement playground swift time-complexity-visualization
Last synced: 18 days ago
JSON representation
Swift Playground for visualizing algorithm time complexity
- Host: GitHub
- URL: https://github.com/johennes/swift-performance-playground
- Owner: Johennes
- License: gpl-3.0
- Created: 2020-09-28T18:31:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T18:10:30.000Z (about 5 years ago)
- Last Synced: 2025-08-22T06:53:02.996Z (about 2 months ago)
- Topics: performance-measurement, playground, swift, time-complexity-visualization
- Language: Swift
- Homepage:
- Size: 426 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
Swift Performance Playground
============================This is a skeleton Swift Playground for visualizing the time complexity of
algorithms.![Playground and resulting chart for two example algorithms]
Usage
-----To see a working example, open `Performance.playground` and scroll to the
bottom. Once you run the Playground (`CMD + SHIFT + RET`), the resulting time
chart (plotting time in seconds over the input size) will start drawing in the
live view.To test your own algorithms, customize the contents of the `Chart Display` and
`Measurements` sections.Measurements are driven by an input data specification. The following is an
example specification that steps from 1 to 1,000,000 multiplying the current
size by 4 in each step and returning an accordingly sized randomized array of
integers.``` {.swift}
let input = Timekeeper.InputSpec(
minSize: 1,
maxSize: 1000000,
step: { $0 * 4 }) { inputSize in
(0..