-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Don't merge [benchmark] Compile and run benchmark on Linux #7810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Contributed my patch to the community. @bitjammer @lplarson Please review |
@swift-ci Please benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -133,7 +133,7 @@ public func run_MapReduceShortString(_ N: Int) { | |||
|
|||
@inline(never) | |||
public func run_MapReduceClass(_ N: Int) { | |||
let numbers = (0..<1000).map { NSDecimalNumber(value: $0) } | |||
let numbers = (0..<1000).map { NSDecimalNumber(integerLiteral: $0) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's preferred not to call the ExpressibleBy...
methods directly. Maybe it makes sense to replace this use of NSDecimalNumber
with something else, given we now have DecimalNumber
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@airspeedswift NSDecimalNumber(integerLiteral: $0)
can be replaced with Decimal($0)
if we have a way to convert Decimal
to Int
. I don't think Int(NSDecimalNumber(decimal: $0))
makes sense. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 20801a0.
I reverted to the original code and excluded it unless objc runtime is available, as I did for other tests.
@@ -20,6 +20,7 @@ import TestsUtils | |||
|
|||
@inline(never) | |||
public func run_NSDictionaryCastToSwift(_ N: Int) { | |||
#if _runtime(_ObjC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is probably better if practical to just #if
out the entire functions if possible, and then just not call them on Linux, rather than call them with empty bodies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@airspeedswift As described in the comment, utils/main.swift
is generated from templates. My goal is to selectively skip compiling and running each test solely by itself while keeping templates and the generation utility unchanged. I think this is important to avoid any impact to the existing build and test framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future pull request, we should update the generation utility to support #if
defining out entire benchmark functions.
@@ -19,6 +19,7 @@ public func run_StringWithCString(_ N: Int) { | |||
} | |||
|
|||
public func run_StringHasPrefix(_ N: Int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a // FIXME(string)
for these ones? This particular function ought to get added for Linux as part of the String rework, so hopefully we can restore this test on Linux then (unlike some of the objc runtime tests which may only ever run on Darwin).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@airspeedswift Fixed in 7980623. Thanks.
…aints [GenericSignatureBuilder] Remove self-derived same-type-to-concrete constraints.
Build comment file:Optimized (O) Regression (3)
Improvement (5)
No Changes (164)
Regression (1)
Improvement (0)No Changes (171)
|
Those tests were missed because they are not executed currently by mistake (rdar://problem/30762030)
Most of the time, "generics" means "cannot be exposed to Objective-C" and certainly "cannot be exposed in the generated header", but there is one exception: imported Objective-C parameterized types, and their extensions. We were previously dropping this on the floor and printing `Foo</* BarType */>` in the generated header, which is nonsense. https://bugs.swift.org/browse/SR-3480
<rdar://problem/29996841>
[indexer] report defs/refs of parameters without a separate external name
Support opaque values inside open existential boxes
…caching-test [Syntax] Reenable thread-safe caching test
…hat [take] [initialization] does not hightlight the ][ in between the two.
…led checked_cast_br cast. Previously, we would put a destroy_value directly on the value that we tried to cast. Since checked_cast_br is consuming, this would cause the destroy_value on the failure path to be flagged as a double consume. This commit causes SILGen to emit the value consumed by checked_cast_br as an @owned argument to the failure BB, allowing semantic arc rules to be respected. As an additional benefit, I also upgraded the ownership_model_eliminator test to use semantic sil verification. One issue that did come up though is that I was unable to use the new code in all locations in the compiler. Specifically, there is one location in SILGenPattern that uses argument unforwarding. I am going to need to undo argument unforwarding in SILGenPattern in order to completely eliminate the old code path.
This will make it easier to incrementally implement syntax nodes, while allowing us to embed nodes that we do know about inside ones that we don't. https://bugs.swift.org/browse/SR-4062
This checking will also be used for other kinds of constraints (e.g., superclass constraints), so factor it out in advance.
Swift master uses LLVM swift-4.0-branch, which does not yet have the lit change implementing this syntax. This reverts commit dfd10ae.
…ax-children [Syntax] Allow UnknownSyntax to have children
Add benchmark for quadratic hash performance
…shable FloatingPoint should imply Hashable. `Hashable` is related to `Equatable`, and `FloatingPoint` is `Equatable`, with enough additional constraints that `Hashable` conformance is practical. There's *almost* no excuse for any `Equatable` thing not to also be `Hashable`; the exception is when the underlying representation may be denormalized in some way that makes it impossible or expensive to normalize (e.g. `Set`). Floating point numbers have denormalized forms, so this comes down to the cost of normalization. Since we can't imagine a representation whose normalization is much more expensive than the subsequent hashing step, the conformance belongs.
…cts with trivial ownership should never have a cleanup. rdar://29791263
… have the destructure operation yet. rdar://29791263
…ng inst has conflicting ownership. If SIL Ownership is enabled, we still trigger an unreachable. rdar://29791263
…6_64. I put in a small little kludge to add support for this. The better solution is to refactor the supports_benchmark property from Platform to Target. We already have a similar abstraction problem with armv7 target on Darwin, where we explicitly turn off benchmarking. *NOTE* Building the benchmarks for linux still requires more cmake work. I am making some changes in a subsequent commit series to do this. If you try to compile the benchmarks, you will hit an error where ninja says that it doesn't know about the swift-benchmark-linux-x86_64 target.
Avoid some string copies. Although it has no significant measurable effect, it makes me feel better.
… compilation issue.
This shrinks the name length if the same bound generic type is used multiple times, like: func foo(_ x: [Int], _ y: [Int])
It’s better to have a single definition of known types which is then used in the mangler, demangler and remangler. NFC
Instead of appending a character for each substitution, we now prefix the substitution with the repeat count, e.g. AbbbbB -> A5B The same is done for known-type substitutions, e.g. SiSiSi -> S3i This significantly shrinks mangled names which contain large lists of the same type, like func foo(_ x: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)) rdar://problem/30707433
…compiling-stdlib-sutubs-cpp-for-arm fix SR-4166: __mode__ attribute presence check changed.
I did a wrong commit again. |
(This PR has been superseded by #7928)
Exclude Objective-C or Mach specific implementations, or replace them with POSIX based implementations so that we can compile and run benchmark on Linux.