Skip to content

Commit

Permalink
benchmarks: replace the Ounchecked build with an Osize build
Browse files Browse the repository at this point in the history
We don't measure Ounchecked anymore. On the other hand we want to benchmark the Osize build.
  • Loading branch information
eeckstein committed Oct 6, 2017
1 parent 96fe8ef commit 45a2ae4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Available configurations: <Optlevel>_SINGLEFILE, <Optlevel>_MULTITHREADED")
# Syntax for an optset: <optimization-level>_<configuration>
# where "_<configuration>" is optional.
if(NOT SWIFT_OPTIMIZATION_LEVELS)
set(SWIFT_OPTIMIZATION_LEVELS "Onone" "O" "Ounchecked"
set(SWIFT_OPTIMIZATION_LEVELS "Onone" "O" "Osize"
${SWIFT_EXTRA_BENCH_CONFIGS})
endif()

Expand Down
4 changes: 2 additions & 2 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The following build options are available:
(default: "macosx;iphoneos;appletvos;watchos")
* `-DSWIFT_OPTIMIZATION_LEVELS`
* A list of Swift optimization levels to build against
(default: "O;Onone;Ounchecked")
(default: "O;Onone;Osize")
* `-DSWIFT_BENCHMARK_EMIT_SIB`
* A boolean value indicating whether .sib files should be generated
alongside .o files (default: FALSE)
Expand Down Expand Up @@ -92,7 +92,7 @@ Using the Benchmark Driver

* `$ ./Benchmark_O --num-iters=1 --num-samples=1`
* `$ ./Benchmark_Onone --list`
* `$ ./Benchmark_Ounchecked Ackermann`
* `$ ./Benchmark_Osize Ackermann`

### Note
As a shortcut, you can also refer to benchmarks by their ordinal numbers.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function (swift_benchmark_compile_archopts)
set(common_swift4_options ${common_options} "-swift-version" "4")

# Always optimize the driver modules.
# Note that we compile the driver for Ounchecked also with -Ounchecked
# Note that we compile the driver for Osize also with -Osize
# (and not with -O), because of <rdar://problem/19614516>.
string(REPLACE "Onone" "O" driver_opt "${optflag}")

Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_DTrace.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DTRACE_PATH = os.path.join(DRIVER_LIBRARY_PATH, 'swift_stats.d')

import perf_test_driver # noqa (E402 module level import not at top of file)

# Regexes for the XFAIL_LIST. Matches against '([Onone|O|Ounchecked],TestName)'
# Regexes for the XFAIL_LIST. Matches against '([Onone|O|Osize],TestName)'
XFAIL_LIST = [
]

Expand Down
10 changes: 5 additions & 5 deletions benchmark/scripts/Benchmark_Driver
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def main():
'multiple filters are supported', metavar="PATTERN")
parent_parser.add_argument(
'-t', '--tests',
help='directory containing Benchmark_O{,none,unchecked} ' +
help='directory containing Benchmark_O{,none,size} ' +
'(default: DRIVER_DIR)',
default=DRIVER_DIR)

Expand All @@ -411,8 +411,8 @@ def main():
parents=[parent_parser])
submit_parser.add_argument(
'-o', '--optimization', nargs='+',
help='optimization levels to use (default: O Onone Ounchecked)',
default=['O', 'Onone', 'Ounchecked'])
help='optimization levels to use (default: O Onone Osize)',
default=['O', 'Onone', 'Osize'])
submit_parser.add_argument(
'-i', '--iterations',
help='number of times to run each test (default: 10)',
Expand All @@ -435,8 +435,8 @@ def main():
run_parser.add_argument(
'-o', '--optimization',
metavar='OPT',
choices=['O', 'Onone', 'Ounchecked'],
help='optimization level to use: {O,Onone,Ounchecked}, (default: O)',
choices=['O', 'Onone', 'Osize'],
help='optimization level to use: {O,Onone,Osize}, (default: O)',
default='O')
run_parser.add_argument(
'-i', '--iterations',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_GuardMalloc.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sys.path.append("@PATH_TO_DRIVER_LIBRARY@")

import perf_test_driver # noqa (E402 module level import not at top of file)

# Regexes for the XFAIL_LIST. Matches against '([Onone|O|Ounchecked],TestName)'
# Regexes for the XFAIL_LIST. Matches against '([Onone|O|Osize],TestName)'
XFAIL_LIST = [
]

Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class PerformanceTestResult(object):
"""PerformanceTestResult holds results from executing an individual
benchmark from the Swift Benchmark Suite as reported by the test driver
(Benchmark_O, Benchmark_Onone, Benchmark_Ounchecked or Benchmark_Driver).
(Benchmark_O, Benchmark_Onone, Benchmark_Osize or Benchmark_Driver).
It depends on the log format emitted by the test driver in the form:
#,TEST,SAMPLES,MIN(μs),MAX(μs),MEAN(μs),SD(μs),MEDIAN(μs),MAX_RSS(B)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/perf_test_driver/perf_test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _unwrap_self(args):
return type(args[0]).process_input(*args)


BenchmarkDriver_OptLevels = ['Onone', 'O', 'Ounchecked']
BenchmarkDriver_OptLevels = ['Onone', 'O', 'Osize']


class BenchmarkDriver(object):
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SwiftExternalBenchmarkBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function (add_external_benchmark_suite)
set(stamp_dir ${SWIFT_BINARY_DIR}/external-benchmark/stamps)
set(prefix_dir ${SWIFT_BINARY_DIR}/external-benchmark/prefix)

set(bench_targets Benchmark_O Benchmark_Onone Benchmark_Ounchecked)
set(bench_targets Benchmark_O Benchmark_Onone Benchmark_Osize)
set(library_targets swift-benchmark-macosx-x86_64-external)

set(all_stdlib_dependencies)
Expand Down

0 comments on commit 45a2ae4

Please sign in to comment.