Commit Graph

1438 Commits

Author SHA1 Message Date
Erik Eckstein
fb65284995 benchmarks: fix run_smoke_bench after upgrading to python3
Need to decode result of `subprocess.check_output`
2022-04-19 13:59:55 +02:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
zoecarver
839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00
Daniel Duan
06a04624a6 [benchmark] Remove Python 2 logic (#42048)
Found a few pieces of Python 2 code. Remove them since we are on Python
3 entirely.
2022-03-27 15:02:58 -07:00
Egor Zhdan
626eadcf64 [cxx-interop] Import size_t as Int instead of UInt on Linux
When using libc++, Swift imports `size_t` as Int despite `size_t` being an unsigned type. This is intentional & is specified in `lib/ClangImporter/MappedTypes.def`. Previously, MappedTypes were only honored for C/C++ types declared on the file level.

In libstdc++, `size_t` is declared within `namespace std` and not on the file level, so the mapping to Int was not applied.

This change ensures that MappedTypes are also applied to types declared in `namespace std`.
2022-03-24 15:29:19 +00:00
Nate Chandler
1a0cd33ca0 [Benchmark] Shortened local var lifetime. 2022-03-16 20:45:40 -07:00
Nuri Amari
cda2c26d8c Create ReadAccessor benchmark
Create a benchmark to test the
performance of synthesized read
accessors generated to interop
with C++ [] operators.
2022-03-07 10:19:25 -05:00
David Smith
c1957a3993 Add a benchmark for CFStringInlineBuffer on bridged Strings 2022-03-04 13:09:29 -08:00
swift-ci
32a967f1ea Merge pull request #39171 from eltociear/patch-22 2022-01-13 07:01:02 -08:00
冀卓疌
8ef5e9e0e3 Merge pull request #40706 from eltociear/patch-27
[benchmark] Fix typo in SIMDReduceInteger.swift
2022-01-13 16:15:01 +08:00
BenedictSt
fdb05626c7 Fixed typo: desciption -> description
benchmark/utils/ArgParse.swift

desciption -> description
2022-01-05 11:18:04 +01:00
Ikko Ashimine
085a9bb06a [benchmark] Fix typo in SIMDReduceInteger.swift
Intialize -> Initialize
2021-12-26 14:37:12 +09:00
Erik Eckstein
43506a01f1 cmake: fix dependencies in benchmarks
with libswift the compiler invocation also depends on the core libraries, because the compiler executable needs them.

rdar://85911944
2021-12-02 19:57:35 +01:00
Michael Gottesman
81e20fb9cb Remove @_assemblyVision marker that snuck into ChaCha.
I think I was using this as part of a demo at some point and it snuck into
tree.
2021-11-14 11:28:37 -08:00
Evan Wilde
6956b7c5c9 Replace /usr/bin/python with /usr/env/python
/usr/bin/python doesn't exist on ubuntu 20.04 causing tests to fail.
I've updated the shebangs everywhere to use `/usr/bin/env python`
instead.
2021-09-28 10:05:05 -07:00
Erik Eckstein
4447fe0cb0 benchmarks: Fix an integer overflow problem in the MapReduce benchmarks on 32-bit targets 2021-09-22 20:22:50 +02:00
Erik Eckstein
5ff6308e05 benchmarks: disable some unstable benchmarks
and scale a substring test
2021-09-22 08:39:06 +02:00
Karoy Lorentey
8304e6c0bf Merge pull request #39336 from lorentey/decapitate-benchmarks
[benchmark][NFC] Use Swift naming conventions
2021-09-20 17:16:35 -07:00
Karoy Lorentey
386ae586e5 [benchmark] Document deterministic hashing requirement 2021-09-16 20:23:47 -07:00
Karoy Lorentey
758c52bc2a [benchmark] Don't create array instance in modules with solitary benchmarks
It just produces unnecessary code sign churn.
2021-09-16 18:54:14 -07:00
Karoy Lorentey
110d123731 [benchmark] Fix silly thinkos in Ackermann & Fibonacci 2021-09-16 18:00:37 -07:00
Karoy Lorentey
ec0fbc0d4b [benchmark] Use swift-darwin-postprocess.py to work around dyld 4 issue on macOS 12 2021-09-16 16:58:13 -07:00
Karoy Lorentey
2fbf391b57 [benchmark] Benchmark_Driver: Correctly set SWIFT_DETERMINISTIC_HASHING 2021-09-16 16:57:35 -07:00
Karoy Lorentey
6cf798cd6d [benchmark] Trap if deterministic hashing isn't enabled 2021-09-16 16:57:06 -07:00
Karoy Lorentey
ee34b02b30 [benchmark] Fixup expected output in MirrorTest after module rename 2021-09-16 16:12:00 -07:00
Karoy Lorentey
526527e587 [benchmark] Regenerate gyb 2021-09-16 12:12:39 -07:00
Karoy Lorentey
8944591e71 [benchmark] Simplify benchmark registration 2021-09-15 22:08:08 -07:00
Karoy Lorentey
8910b75cfe [benchmark] Stop capitalizing function and variable names 2021-09-15 22:08:07 -07:00
Karoy Lorentey
958733c812 [benchmark] False() → getFalse() 2021-09-15 22:08:07 -07:00
Karoy Lorentey
bd9a22099a [benchmark] Random(), SRand() → LFSR.init(), .next() 2021-09-15 22:08:07 -07:00
Karoy Lorentey
203dc55b60 [benchmark] CheckResults → check
Capitalizing function names is against Swift naming conventions.
2021-09-15 22:08:07 -07:00
LucianoAlmeida
c3c1e6df8d [Benchmarks][stdlib] Adding an extra benchmark for set isDisjoint for disjoint sets of different size 2021-09-12 21:56:54 -03:00
Ikko Ashimine
c48f6e09bb [benchmark] Fix typo in compare_perf_tests.py
formating -> formatting
2021-09-04 09:10:34 +09:00
swift-ci
65244f042f Merge pull request #38827 from glessard/buffer-benchmarks 2021-08-12 17:08:16 -07:00
Guillaume Lessard
49ae2dd64b Update benchmark/single-source/BufferFill.swift
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2021-08-12 12:49:25 -06:00
Guillaume Lessard
e06d03e860 [benchmark] initialize an UMBP<UInt8> from an URBP 2021-08-10 18:33:46 -06:00
David Smith
376c0293fe Merge pull request #38818 from Catfish-Man/home-home-on-the-rangeofstring
Add benchmarks exercizing bridged rangeOfString more thoroughly
2021-08-10 00:16:31 -07:00
David Smith
15b55bfe4b Rename and rescale benchmarks 2021-08-09 17:59:03 -07:00
David Smith
847047e867 Add benchmarks exercizing bridged rangeOfString more thoroughly in preparation for adding a native version 2021-08-09 16:18:28 -07:00
swift-ci
a92acc72c7 Merge pull request #38621 from glessard/buffer-benchmarks 2021-07-28 12:00:16 -07:00
Guillaume Lessard
210ade36d6 add a reference to a bugs.swift.org report 2021-07-28 10:15:29 -06:00
Guillaume Lessard
314220ff07 benchmarks of performance when filling memory buffers 2021-07-28 01:58:33 -06:00
Michael Gottesman
f432bd9416 Merge pull request #36094 from zoecarver/bump-cmake-req
Bump CMake version to 3.19.6.
2021-07-24 15:37:18 -07:00
Guillaume Lessard
715b3fa7d0 [gardening] update copyright year in the benchmark template 2021-07-22 16:39:15 -06:00
zoecarver
a13c57c360 Bump CMake version to 3.19.6.
Updates the CMake version for Swift and the Swift Benchmarks to 3.19.6.
Updates the docs to reflect this change. Does not modify the required version for building the stdlib.
2021-07-12 08:57:35 -07:00
Michael Gottesman
804bcac1e6 [assembly-vision] Change release to do backwards then forwards when inferring source locs.
TLDR: I fixed a whole in the assembly-vision opt-remark pass where we were not
emitting a remark for end of scope instructions at the beginning of blocks. Now
all of these instructions (strong_release, end_access) should always reliably
have a remark emitted for them.

----

I think that this is a pragmatic first solution to the problem of
strong_release, release_value being the first instruction of a block. For those
who are unaware, this issue is that for a long time we have searched backwards
first for "end of scope" like instructions. This then allows us to identify the
"end of scope" instruction as happening at the end of the previous statement
which is where the developer thinks it should be:

```
var global: Klass
func bar() -> @owned Klass { global }
func foo() {
   // We want the remark for the
   bar()                          // expected-remark {{retain}}
}
```

This makes sense since we want to show end of scope instructions as being
applied to the earlier code whose scope it is ending. We can be clear that it is
at the end of the statement by placing the carrot on the end of statement
SourceLoc so there isn't any confusion upon whether or not

That generally has delivered nice looking results, but what if our release is
the first instruction in the block? In that case, we do not have any instruction
that we can immediately use, so traditionally we just gave up and didn't emit
anything. This is not an acceptable solution! We should be able to emit
something for every retain/release in the program if we want users to be able to
rely upon this! Thus we need to be able to get source location information from
somewhere around

First before we begin, my approach here is informed by my seeing over time that
the optimizer does a pretty good job of not breaking SourceLoc info for
terminators.

With that in mind, there are two possible approaches here: using the terminator
from the previous block and searching forward at worst taking the SourceLoc of
the current block's terminator (or earlier if we find a good SourceLoc). I
wasn't sure what the correct thing to do was at the time so I didn't fix the
issue. After some thought, I realized that the correct solution is to if we fail
a backwards search, search forwards. The reason why is that since our remarks
runs late in the optimization pipeline, there is a very high likelihood that if
we aren't folded into our previous block that there is a true need in the
program for conditional control flow here. We want to avoid placing the release
out of such pieces of code since it is misleading to the user:

```

In this example there is a release inside the case for .x but none for .y. In
that case it is possible that we get a release for .f since payload is passed in
at +1 at SILGen time. In such a case, using the terminator of the previous block
would mean that we would have the release be marked as on payload instead of
inside the case of .x. By using the terminator of the releases block, we can

switch payload {
case let .x(f):
  ...
case let .y:
  ...
}
```

So using the terminator from the previous block would be
  misleading to the user. Instead it is better to pick a location after the release that way
  we know at least the instruction we are inferring from must in some sense be

With this fix, we should not emit locations for all retains, releases. We may
not identify a good source loc for all of them, but we will identify them.

optimization pipeline, if our block was not folded into the previous block there
is a very high liklihood that there is some sort of conditional control flow
that is truly necessary in the program. If we

this
generally implies that there is a real side effect in the program that is
requiring conditional code execution (since the optimizer would have folded it).

The reason why is that we are at least going to hit a terminator or a
side-effect having instruction that generally have debug info preserved by the
optimizer.
2021-07-02 11:51:09 -07:00
Erik Eckstein
b5f1e265e0 benchmarks: disable the flaky test_log_file BenchmarkDriver test
I'm not sure if it makes sense to keep this test around at all.
For now I just disabled it.

rdar://79701124
2021-06-28 13:13:02 +02:00
Stephen Canon
f538b49fc9 Use the "nearly divisionless" algorithm on all targets. (#37920)
* Use the "nearly divisionless" algorithm on all targets.

We have multipliedFullWidth available everywhere now, so we don't need to carry around the old implementation on 32b targets.

Also adds a few more benchmarks for random number generation.

* Obscure the range boundaries for some of the new random value benchmarks.

When these are visible compile-time constants, the compiler is smart enough to evaluate the division in the "nearly divisionless" algorithm, which makes it completely divisionless. That's good, but it obscures what the runtime performance of the algorithm will be when the bounds are _not_ available as compile-time constants. Thus, for some of the newly-added benchmarks, we pass the upper bound through `identity` to hide it from the optimizer (this is imperfect, but it's the simplest tool we have).

We don't want to do this for all the tests for two reasons:
- compile-time constant bounds are a common case that should still be reflected in our testing
- we don't want to perturb existing benchmark results more than we have to.
2021-06-15 20:27:49 -04:00
Mishal Shah
ddabee30e2 Add arch info to benchmark report 2021-06-01 09:59:20 -07:00
Erik Eckstein
abcae7bfa1 benchmarks: fix smoke test run by setting the dynamic library path
This is a workaround for rdar://78584073
2021-05-31 15:10:08 +02:00