Skip to content

Commit 4e36e21

Browse files
authored
Merge pull request #61565 from hyp/eng/benchmark-relinux
[interop] cxx vector benchmark - reenable without SwiftPM support
2 parents a0d8ba2 + cd63444 commit 4e36e21

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

benchmark/cxx-source/CxxVectorSum.swift

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,16 @@
1515

1616
import TestsUtils
1717

18-
public let benchmarks: [BenchmarkInfo] = []
19-
#if FIX_61472
18+
#if SWIFT_PACKAGE
19+
// FIXME: Needs fix for https://github.com/apple/swift/issues/61547.
2020

21-
import std
21+
public let benchmarks = [BenchmarkInfo]()
2222

23-
// FIXME: remove workaround for: https://github.com/apple/swift/issues/61472
24-
public func __workaround_std_import() {
25-
let s = std.string()
26-
blackHole(s.size())
27-
}
23+
#else
2824

2925
import CxxStdlibPerformance
3026
import Cxx
3127

32-
// FIXME: Linux needs fix for https://github.com/apple/swift/issues/61547.
33-
#if os(Linux)
34-
public let benchmarks: [BenchmarkInfo] = []
35-
#else
3628
public let benchmarks = [
3729
BenchmarkInfo(
3830
name: "CxxVecU32.sum.Cxx.rangedForLoop",
@@ -139,4 +131,3 @@ extension VectorOfU32.const_iterator : Equatable, UnsafeCxxInputIterator { }
139131

140132
extension VectorOfU32: CxxSequence {}
141133
#endif
142-
#endif

benchmark/scripts/Benchmark_Driver

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ class MarkdownReportHandler(logging.StreamHandler):
408408
msg = self.format(record)
409409
stream = self.stream
410410
try:
411-
if isinstance(msg, str) and getattr(stream, "encoding", None):
412-
stream.write(msg.encode(stream.encoding))
411+
if isinstance(msg, str) and (getattr(stream, "encoding", None) and
412+
getattr(stream, "buffer", None)):
413+
stream.buffer.write(msg.encode(stream.encoding))
413414
else:
414415
stream.write(msg)
415416
except UnicodeError:

0 commit comments

Comments
 (0)