-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SR-10555 foreignCopyUTF8 should do bulk access #24289
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
b67972b
to
c90534e
Compare
@swift-ci please smoke 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.
Want to make sure we trigger the precondition failure. Might be worth adding a test case to StringTraps.swift for this.
c90534e
to
11eae01
Compare
@swift-ci please smoke benchmark |
@swift-ci please smoke test |
Oops, forgot to make that conditional for 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.
LGTM, let's see if it's covered by a benchmark
Performance: -O
Performance: -Osize
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Alas, will have to write some new benchmarks |
@swift-ci please smoke benchmark |
Performance: -O
Performance: -Osize
Performance: -Onone
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
2.6x win, that’s more like it! |
This seems related: [ RUN ] StringUTF8Tests.Contiguous Access
stdout>>> abcd
stdout>>> abcdefghijklmnop
stdout>>> abcdéfghijk
stderr>>> Fatal error: invalid Collection: less than 'count' elements in collection: file /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/stdlib/public/core/ContiguousArrayBuffer.swift, line 643
stderr>>> Current stack trace:
stderr>>> 0 libswiftCore.dylib 0x0000000109dfb020 _swift_stdlib_reportFatalErrorInFile + 116
stderr>>> 1 libswiftCore.dylib 0x0000000109d14b80 specialized closure #1 in closure #1 in closure #1 in _fatalErrorMessage(_:_:file:line:flags:) + 304
stderr>>> 2 libswiftCore.dylib 0x0000000109d14dc0 specialized closure #1 in closure #1 in _fatalErrorMessage(_:_:file:line:flags:) + 110
stderr>>> 3 libswiftCore.dylib 0x0000000109cd2ff0 specialized closure #1 in _fatalErrorMessage(_:_:file:line:flags:) + 124
stderr>>> 4 libswiftCore.dylib 0x0000000109cd3420 specialized _fatalErrorMessage(_:_:file:line:flags:) + 643
stderr>>> 5 libswiftCore.dylib 0x0000000109cda0a0 specialized _copyCollectionToContiguousArray<A>(_:) + 900
stderr>>> 6 libswiftCore.dylib 0x0000000109bbdf50 _StringGuts._foreignGrow(_:) + 56
stderr>>> 7 libswiftCore.dylib 0x0000000109bbe170 _StringGuts.prepareForAppendInPlace(otherUTF8Count:) + 1323
stderr>>> 8 libswiftCore.dylib 0x0000000109bbebf0 _StringGuts.append(_:) + 324
stderr>>> 9 libswiftCore.dylib 0x0000000109cdb050 specialized _StringGuts.append(_:) + 230
stderr>>> 10 libswiftCore.dylib 0x0000000109a5d8c0 static String.+= infix(_:_:) + 21
stderr>>> 11 String 0x00000001090eb250 String.makeNative() + 49
stderr>>> 12 String 0x00000001090eb3e0 closure #1 in + 3736
stderr>>> 13 libswiftStdlibUnittest.dylib 0x00000001096fa890 specialized TestSuite._runTest(name:parameter:) + 584
stderr>>> 14 libswiftStdlibUnittest.dylib 0x00000001096b8ef0 _childProcess() + 846
stderr>>> 15 String 0x00000001090ead30 main + 667
stderr>>> 16 libdyld.dylib 0x00007fff62cc9ed8 start + 1
stderr>>> CRASHED: SIGILL
the test crashed unexpectedly
[ FAIL ] StringUTF8Tests.Contiguous Access
StringUTF8Tests: Some tests failed, aborting
UXPASS: []
FAIL: ["Contiguous Access"]
SKIP: []
To debug, run:
$ /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/validation-test-macosx-x86_64/stdlib/Output/StringUTF8.swift.tmp/String --stdlib-unittest-in-process --stdlib-unittest-filter "Contiguous Access" |
Yeah, definitely something wrong around the edges of this. Will figure out what and land it on Monday :) My guess is that we’re ending up in a situation where CFStringGetBytes reports a different number of “characters” converted than what we calculated with .utf8.count |
11eae01
to
cf78d24
Compare
@swift-ci please test |
Build failed |
cf78d24
to
fd0d4d8
Compare
@swift-ci please test |
Build failed |
Build failed |
Linux failure is a known unrelated hang |
@swift-ci please smoke test linux platform |
@swift-ci please test linux platform |
oops. Guess those both worked >.< |
What was the bug and why did this fix it? Also, can you test and make sure it gives the same result if the foreign string has unpaired surrogates? |
Fixes https://bugs.swift.org/browse/SR-10555 and rdar://50220164