All Projects → google → Swift Benchmark

google / Swift Benchmark

Licence: apache-2.0
A swift library to benchmark code snippets.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swift Benchmark

Pedestron
[Pedestron] Generalizable Pedestrian Detection: The Elephant In The Room. On ArXiv 2020
Stars: ✭ 352 (-46.59%)
Mutual labels:  benchmarking
Fiber2d
Cross-platform 2D Game Engine in pure Swift
Stars: ✭ 415 (-37.03%)
Mutual labels:  swiftpm
Cleverhans
An adversarial example library for constructing attacks, building defenses, and benchmarking both
Stars: ✭ 5,356 (+712.75%)
Mutual labels:  benchmarking
Pyperf
Toolkit to run Python benchmarks
Stars: ✭ 359 (-45.52%)
Mutual labels:  benchmarking
Tufte
Simple profiling and performance monitoring for Clojure/Script
Stars: ✭ 401 (-39.15%)
Mutual labels:  benchmarking
Processhacker
A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Stars: ✭ 6,285 (+853.72%)
Mutual labels:  benchmarking
Hrm Solutions
Human Resource Machine solutions and size/speed hacks
Stars: ✭ 332 (-49.62%)
Mutual labels:  benchmarking
Fuzzbench
FuzzBench - Fuzzer benchmarking as a service.
Stars: ✭ 612 (-7.13%)
Mutual labels:  benchmarking
Deferred
Work with values that haven't been determined yet.
Stars: ✭ 406 (-38.39%)
Mutual labels:  swiftpm
Tsbs
Time Series Benchmark Suite, a tool for comparing and evaluating databases for time series data
Stars: ✭ 545 (-17.3%)
Mutual labels:  benchmarking
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+462.97%)
Mutual labels:  swiftpm
Keyboardobserving
⌨️A Combine-based way to observe and adjust for Keyboard notifications in SwiftUI
Stars: ✭ 399 (-39.45%)
Mutual labels:  swiftpm
Lzbench
lzbench is an in-memory benchmark of open-source LZ77/LZSS/LZMA compressors
Stars: ✭ 490 (-25.64%)
Mutual labels:  benchmarking
Genrl
A PyTorch reinforcement learning library for generalizable and reproducible algorithm implementations with an aim to improve accessibility in RL
Stars: ✭ 356 (-45.98%)
Mutual labels:  benchmarking
Noisia
Harmful workload generator for PostgreSQL
Stars: ✭ 591 (-10.32%)
Mutual labels:  benchmarking
Benchmarking Keras Pytorch
🔥 Reproducibly benchmarking Keras and PyTorch models
Stars: ✭ 346 (-47.5%)
Mutual labels:  benchmarking
Hero
Elegant transition library for iOS & tvOS
Stars: ✭ 20,547 (+3017.91%)
Mutual labels:  swiftpm
Llvmswift
A Swift wrapper for the LLVM C API (version 9.0.1)
Stars: ✭ 641 (-2.73%)
Mutual labels:  swiftpm
Reflection
DEPRECATED
Stars: ✭ 592 (-10.17%)
Mutual labels:  swiftpm
Performance Analysis Js
Map/Reduce/Filter/Find Vs For loop Vs For each Vs Lodash vs Ramda
Stars: ✭ 532 (-19.27%)
Mutual labels:  benchmarking

swift-benchmark

A Swift library for benchmarking code snippets, similar to google/benchmark.

Example:

import Benchmark

benchmark("add string reserved capacity") {
    var x: String = ""
    x.reserveCapacity(2000)
    for _ in 1...1000 {
        x += "hi"
    }
}

Benchmark.main()

At runtime, you can filter which benchmarks to run by using the --filter command line flag. For more details on what options are available, pass either the -h or --help command line flags.

Example:

$ swift run -c release BenchmarkMinimalExample --help
USAGE: benchmark-command [--allow-debug-build] [--filter <filter>] [--filter-not <filter-not>] [--iterations <iterations>] [--warmup-iterations <warmup-iterations>] [--min-time <min-time>] [--max-iterations <max-iterations>] [--time-unit <time-unit>] [--inverse-time-unit <inverse-time-unit>] [--columns <columns>] [--format <format>] [--quiet]

OPTIONS:
  --allow-debug-build     Overrides check to verify optimized build.
  --filter <filter>       Run only benchmarks whose names match the regular expression.
  --filter-not <filter-not>
                          Exclude benchmarks whose names match the regular expression.
  --iterations <iterations>
                          Number of iterations to run.
  --warmup-iterations <warmup-iterations>
                          Number of warm-up iterations to run.
  --min-time <min-time>   Minimal time to run when automatically detecting number iterations.
  --max-iterations <max-iterations>
                          Maximum number of iterations to run when automatically detecting number iterations.
  --time-unit <time-unit> Time unit used to report the timing results.
  --inverse-time-unit <inverse-time-unit>
                          Inverse time unit used to report throughput results.
  --columns <columns>     Comma-separated list of column names to show.
  --format <format>       Output format (valid values are: json, csv, console, none).
  --quiet                 Only print final benchmark results.
  -h, --help              Show help information.

$ swift run -c release BenchmarkMinimalExample
running add string no capacity... done! (1832.52 ms)
running add string reserved capacity... done! (1813.96 ms)

name                         time     std        iterations
-----------------------------------------------------------
add string no capacity       37435 ns ±   6.22 %      37196
add string reserved capacity 37022 ns ±   1.75 %      37749

For more examples, see Sources/BenchmarkMinimalExample and Sources/BenchmarkSuiteExample.

Usage

Add this library as a SwiftPM dependency:

dependencies: [
    .package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
]

Roadmap

The project is in an early stage and offers only a basic set of benchmarking utilities. Feel free to file issues and feature requests to help us prioritize what to do next.

License

Please see LICENSE for details.

Contributing

Please see CONTRIBUTING.md for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].