Commit Graph

28 Commits

Author SHA1 Message Date
cui fliter
127077b3aa chore: fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 17:23:22 +08:00
Max Desiatov
21a2b78801 stdlib/benchmark: add canImport(Musl) where needed (#67120)
This allows compiling stdlib and benchmarks when targeting musl instead of Glibc.
2023-07-05 19:55:08 +01:00
BenedictSt
fdb05626c7 Fixed typo: desciption -> description
benchmark/utils/ArgParse.swift

desciption -> description
2022-01-05 11:18:04 +01:00
Pavol Vaskovic
ec32140aed [benchmark] Run benchmarks using substring filters
Added support for running benchmarks using substring filters. Positional arguments prefixed with a single + or - sign are interpreted as benchmark name filters.

Excecutes all benchmarks whose names include any of the strings prefixed with a plus sign but none of the strings prefixed with a minus sign.
2019-07-07 11:59:45 +02:00
Pavol Vaskovic
5190db0acd [Gardening][benchmark] Import MSVCRT on Windows
Import functions from standard C library on Windows.
2019-07-01 16:11:55 +02:00
Pavol Vaskovic
7c951410f4 [Gardening] Remove extra Foundation imports
Remove the import of Foundation where it is not necessary for testing the ObjC interop.
2019-06-28 16:42:27 +02:00
Andreas Jönsson
09768f29c5 [benchmark] fixes index(of:) deprecation warnings in ArgParse 2018-11-27 22:57:22 +01:00
Pavol Vaskovic
362f925e37 [benchmark][Gardening] Docs and error handling
* Improved documentation.
* Corrected`fflush` usage in `parse` error handling.
* Removed unused `passThroughArgs`.
2018-07-23 18:01:23 +02:00
Pavol Vaskovic
f89d41ad3b [benchmark] Print detailed argument help
The `--help` option now prints standard usage description with documentaion for all arguments:

````
 $ Benchmark_O --help
usage: Benchmark_O [--argument=VALUE] [TEST [TEST ...]]

positional arguments:
 TEST           name or number of the benchmark to measure

optional arguments:
 --help         show this help message and exit
 --num-samples  number of samples to take per benchmark; default: 1
 --num-iters    number of iterations averaged in the sample;
                default: auto-scaled to measure for 1 second
 --iter-scale   number of seconds used for num-iters calculation
                default: 1
 --verbose      increase output verbosity
 --delim        value delimiter used for log output; default: ,
 --tags         run tests matching all the specified categories
 --skip-tags    don't run tests matching any of the specified
                categories; default: unstable,skip
 --sleep        number of seconds to sleep after benchmarking
 --list         don't run the tests, just log the list of test
                numbers, names and tags (respects specified filters)
````
2018-07-21 22:58:44 +02:00
Pavol Vaskovic
0c0ed3d35d [benchmark][Gardening] Moved parseArgs into parser
The `parseArgs` funtion is now a private method on `ArgumentParser`.

Removed `Arguments` struct and moved the `Argument` as a nested struct into the parser.

Adjusted error messages and the corresponding checks.
2018-07-21 15:53:09 +02:00
Pavol Vaskovic
50c79c5972 [benchmark][Gardening] Local parser error handling
In case of invalid command line arguments, there is no reasonable recovery, the `ArgumentParser` can exit the program itself.  It is therefore no longer necessary to propagate the `ArgumentError`s outside of the parser.
2018-07-21 13:30:32 +02:00
Pavol Vaskovic
f674dd5cf0 [benchmark][Gardening] Handle --help inside parser
Moved the printing of help message inside the `ArgumentParser`, which has all the necessary info.

Added test that checks the `--help` option.
2018-07-21 13:16:08 +02:00
Pavol Vaskovic
e5cbfccd22 [benchmark][Gardening] Declarative ArgumentParser
The `ArgumentParser` now has a configuration phase which specifies the supported arguments and their handling. The configured parser is then executed using the `parse` method which returns the parsed result.
2018-07-21 01:32:40 +02:00
Pavol Vaskovic
9f902866ea [benchmark][Gardening] Extracted ArgumentParser
Moved the argument parsing logic into new class `ArgumentParser`. The `checked` function is also moved to the ArgParse.swift, next to the parser.
2018-07-21 01:32:40 +02:00
Pavol Vaskovic
7d19a03dce [benchmark] Gracefully type-check attribute values
We no longer crash when the argument value parsing fails, but report an error.
2018-07-21 01:32:40 +02:00
Pavol Vaskovic
371f155258 [benchmark] Exit gracefully on argument errors
Refactored to use Swift’s idiomatic error handling.
In case of invalid argument errors, the message is printed to `stderr` and we exit gracefully with error code 1. We no longer crash the app in most cases.
2018-07-21 01:32:40 +02:00
Michael Gottesman
3aa039673d [benchmark] Use String.split instead of String.components.
This allows the benchmarks to be built without the Foundation overlay being
built. I am currently prototyping having +0 parameters for all normal arguments
and have not gotten the Foundation overlay to work yet... so this commit will
let me get some initial numbers for the subset of the tests that do not depend
on Foundation.

rdar://34222540
2017-12-07 10:59:28 -08:00
Max Moiseev
cc723b9aff Minor refactoring 2017-10-02 17:10:44 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Tony Parker
f65c1390cb Rename Process to CommandLine
Rename Process to CommandLine [SE-0086].
2016-07-18 17:02:02 -07:00
Chris Willmore
a4484ffa09 Fix use of String.componentsSeparated(by:) in benchmark. 2016-04-07 23:39:23 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Gribenko
24218e08c3 Fix build failure after String API changes 2016-02-24 14:09:04 -08:00
Dmitri Gribenko
e81f99d7ea stdlib: Sequence.startsWith() => .starts(with:) 2016-02-23 18:12:09 -08:00
Dmitri Gribenko
51ce68ce0f Fix benchmarks after Optional.None => .none rename 2016-02-20 00:55:35 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Luke Larson
0356ec8ec3 Add Swift Benchmark Suite 2016-02-08 10:47:58 -08:00