Skip to content

Releases: ordo-one/package-benchmark

1.6.0

01 Jun 12:39
6a9f3e1
Compare
Choose a tag to compare

1.6.0 (2023-06-01)

Bug Fixes

  • minor: Fix improper generation of benchmark targets (#159) (6a9f3e1)

1.5.1

01 Jun 11:47
94acbd8
Compare
Choose a tag to compare

What's Changed

  • chore: correct scalingFactor type in documentation by @dimlio in #158
  • docs: updating CI example with more data and permissions settings by @heckj in #156
  • docs: Correct readme for adding benchmark targets manually by @GNMoseke in #157

New Contributors

Full Changelog: 1.5.0...1.5.1

1.5.0

21 Apr 08:55
eb5c4b2
Compare
Choose a tag to compare

Added additional ways to customize startup/teardown code for benchmarks

There are now multiple ways to setup shared benchmark setup/teardown code (the old startupHook/shutdownHooks are deprecated and will be removed in a future major release, please use Benchmark.setup and Benchmark.teardown instead).

First off, one can easily setup global shared state that can be reused by just defining it in the closure:

import Benchmark

let benchmarks = {
    let mySharedSetup = [1, 2, 3, 4]

    Benchmark("Minimal benchmark") { benchmark in
    // Some work to measure here, use mySharedSetup
    }

    Benchmark("Minimal benchmark 2") { benchmark in
    // Some work to measure here, use mySharedSetup here too
    }
}

Secondly, one can have setup/teardown closures that are shared across all benchmarks:

import Benchmark

let benchmarks = {
    Benchmark.setup = { print("global setup closure, used for all benchmarks") }
    Benchmark.teardown = { print("global teardown closure, used for all benchmarks") }

    Benchmark("Minimal benchmark") { benchmark in
    // Some work to measure here, use mySharedSetup
    }

    Benchmark("Minimal benchmark 2") { benchmark in
    // Some work to measure here, use mySharedSetup here too
    }
}

Thirdly, one can have setup/teardown closures as part of the configuration for a subset of benchmarks

import Benchmark

func setupFunction() {
}

func teardownFunction() {
}

let benchmarks = {

// only shared setup
Benchmark("Minimal benchmark", 
    configuration: .init(setup: setupFunction, teardown: teardownFunction)) { benchmark in 
    // Some work to measure here
}

Benchmark("Minimal benchmark 2", 
    configuration: .init(setup: setupFunction, teardown: teardownFunction)) { benchmark in
    // Some work to measure here
    }
}

Finally, one can have setup/teardown closures that are specific to a given benchmark

import Benchmark

let benchmarks = {

Benchmark("Minimal benchmark") { benchmark in 
    } setup: {
     // do setup for this benchmark here
    } teardown: {
     // do teardown here
    }
}

All of these setup/teardown hooks can be combined, the order of execution is:

  • Global setup
  • Configuration provided setup
  • Closure provided setup

with teardown in reverse order.

So to use all hooks at the same time:

import Benchmark

func sharedSetup() {
}

func sharedTeardown() {
}

let benchmarks = {

    Benchmark.setup = { print("global setup closure, used for all benchmarks") }
    Benchmark.teardown = { print("global teardown closure, used for all benchmarks") }


    Benchmark("Minimal benchmark", 
    configuration: .init(setup: setupFunction, teardown: teardownFunction)) { benchmark in 
    } setup: {
    // do setup for this benchmark here
    } teardown: {
    // do teardown here
    }
}

1.5.0 (2023-04-21)

Features

  • minor: Add more thorough setup/teardown hooks (#153) (eb5c4b2)

1.4.8

18 Apr 18:33
d98ed5a
Compare
Choose a tag to compare

Fix SPI compatibility

1.4.7

18 Apr 06:23
d98ed5a
Compare
Choose a tag to compare
fix: Make SPI builds work for macOS (#150)

1.4.6: fix: Fix Swift 5.7 toolchain support (#149)

17 Apr 16:00
51066a6
Compare
Choose a tag to compare
Workaround https://github.com/apple/swift/issues/60876 so we can build with Swift 5.7 again

1.4.5

17 Apr 11:17
46348d8
Compare
Choose a tag to compare

1.4.5 (2023-04-17)

Bug Fixes

1.4.4

17 Apr 07:40
235a9f6
Compare
Choose a tag to compare

1.4.4 (2023-04-17)

1.4.3

30 Mar 19:57
9a5cd29
Compare
Choose a tag to compare

What's Changed

  • chore: make startup and shutdown hooks async (and throwing) by @dimlio in #141

Full Changelog: 1.4.2...1.4.3

1.4.2

30 Mar 10:40
da9cefd
Compare
Choose a tag to compare

1.4.2 (2023-03-30)

Bug Fixes

  • patch: Update histogram dependency with proper p0/p100 (#140) (da9cefd)