Skip to content

Commit 0bd543d

Browse files
committed
Merge branch 'future' into update-lifetimes-feature
2 parents bb52b40 + 4bf6ba8 commit 0bd543d

File tree

63 files changed

+10706
-2551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+10706
-2551
lines changed

.github/workflows/automerge_to_future.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Create PR to merge release branch into the main branch
22
# At the end of a release cycle and the start of a new one, we may want to automatically forward all changes to the current branch (main) to the branch for the next release (future).
33
# This workflow can be disabled earlier in the release cycle in the GitHub UI as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
4+
permissions:
5+
contents: read
46
on:
57
schedule:
68
- cron: '0 9 * * *'

.github/workflows/automerge_to_main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Create PR to merge release branch into the main branch
22
# At the end of a release cycle, we may want to automatically include all changes to release branches on the main branch to avoid the need for cherry-picking changes back to release branches
33
# This workflow can be disabled earlier in the release cycle in the GitHub UI as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
4+
permissions:
5+
contents: read
46
on:
57
schedule:
68
- cron: '0 9 * * *'

.github/workflows/automerge_to_release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Create PR to merge main into release branch
22
# In the first period after branching the release branch, we typically want to include many changes from `main` in the release branch. This workflow automatically creates a PR every Monday to merge main into the release branch.
33
# Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow. To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
4+
permissions:
5+
contents: read
46
on:
57
schedule:
68
- cron: '0 9 * * MON'

.github/workflows/pull_request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Pull request
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
types: [opened, reopened, synchronize]
@@ -19,6 +22,8 @@ jobs:
1922
macos_versions: '["sequoia"]'
2023
enable_wasm_sdk_build: true
2124
wasm_sdk_versions: '["nightly-main"]'
25+
enable_android_sdk_build: true
26+
android_sdk_versions: '["nightly-main"]'
2227

2328
cmake_build:
2429
name: Build (CMake)

Benchmarks/Benchmarks/Internationalization/BenchmarkCalendar.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import FoundationInternationalization
2020
import Foundation
2121
#endif
2222

23+
#if FOUNDATION_FRAMEWORK
24+
// FOUNDATION_FRAMEWORK has a scheme per benchmark file, so only include one benchmark here.
25+
let benchmarks = {
26+
calendarBenchmarks()
27+
}
28+
#endif
29+
2330
func calendarBenchmarks() {
2431

2532
Benchmark.defaultConfiguration.maxIterations = 1_000
@@ -130,7 +137,6 @@ func calendarBenchmarks() {
130137
}
131138

132139
// MARK: - Allocations
133-
134140
let reference = Date(timeIntervalSince1970: 1474666555.0) //2016-09-23T14:35:55-0700
135141

136142
let allocationsConfiguration = Benchmark.Configuration(
@@ -208,7 +214,6 @@ func calendarBenchmarks() {
208214
assert(identifier == "en_US")
209215
}
210216
}
211-
212217
// MARK: - Identifiers
213218

214219
Benchmark("identifierFromComponents", configuration: .init(scalingFactor: .mega)) { benchmark in

Benchmarks/Benchmarks/Internationalization/BenchmarkLocale.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import FoundationInternationalization
2020
import Foundation
2121
#endif
2222

23+
#if FOUNDATION_FRAMEWORK
24+
// FOUNDATION_FRAMEWORK has a scheme per benchmark file, so only include one benchmark here.
25+
let benchmarks = {
26+
localeBenchmarks()
27+
}
28+
#endif
29+
2330
func localeBenchmarks() {
2431
Benchmark.defaultConfiguration.maxIterations = 1_000
2532
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
@@ -57,4 +64,3 @@ func localeBenchmarks() {
5764
}
5865
}
5966
}
60-
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2022-2023 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
import Benchmark
14+
import func Benchmark.blackHole
15+
16+
#if os(macOS) && USE_PACKAGE
17+
import FoundationEssentials
18+
import FoundationInternationalization
19+
#else
20+
import Foundation
21+
#endif
22+
23+
#if FOUNDATION_FRAMEWORK
24+
// FOUNDATION_FRAMEWORK has a scheme per benchmark file, so only include one benchmark here.
25+
let benchmarks = {
26+
timeZoneBenchmarks()
27+
}
28+
#endif
29+
30+
let testDates = {
31+
var now = Date.now
32+
var dates: [Date] = []
33+
for i in 0...10000 {
34+
dates.append(Date(timeInterval: Double(i * 3600), since: now))
35+
}
36+
return dates
37+
}()
38+
39+
func timeZoneBenchmarks() {
40+
41+
Benchmark.defaultConfiguration.maxIterations = 1_000
42+
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
43+
Benchmark.defaultConfiguration.scalingFactor = .kilo
44+
Benchmark.defaultConfiguration.metrics = [.cpuTotal, .mallocCountTotal, .throughput, .peakMemoryResident]
45+
46+
guard let t = TimeZone(identifier: "America/Los_Angeles") else {
47+
fatalError("unexpected failure when creating time zone")
48+
}
49+
50+
Benchmark("secondsFromGMT", configuration: .init(scalingFactor: .mega)) { benchmark in
51+
for d in testDates {
52+
let s = t.secondsFromGMT(for: d)
53+
blackHole(s)
54+
}
55+
}
56+
57+
Benchmark("creatingTimeZones", configuration: .init(scalingFactor: .mega)) { benchmark in
58+
for name in NSTimeZone.knownTimeZoneNames {
59+
let t = TimeZone(identifier: name)
60+
blackHole(t)
61+
}
62+
}
63+
64+
Benchmark("secondsFromGMT_manyTimeZones", configuration: .init(scalingFactor: .mega)) { benchmark in
65+
for name in NSTimeZone.knownTimeZoneNames {
66+
let t = TimeZone(identifier: name)!
67+
for d in testDates {
68+
let s = t.secondsFromGMT(for: d)
69+
blackHole(s)
70+
}
71+
blackHole(t)
72+
}
73+
}
74+
}
75+
76+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import Benchmark
22

3+
4+
#if os(macOS) && USE_PACKAGE
35
let benchmarks = {
46
calendarBenchmarks()
57
localeBenchmarks()
8+
timeZoneBenchmarks()
69
}
10+
#endif

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ list(APPEND _SwiftFoundation_versions
102102
"6.1"
103103
"6.2"
104104
"6.3"
105+
"6.4"
105106
)
106107

107108
# Each availability name to define

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import CompilerPluginSupport
99
let availabilityTags: [_Availability] = [
1010
_Availability("FoundationPreview"), // Default FoundationPreview availability
1111
]
12-
let versionNumbers = ["6.0.2", "6.1", "6.2", "6.3"]
12+
let versionNumbers = ["6.0.2", "6.1", "6.2", "6.3", "6.4"]
1313

1414
// Availability Macro Utilities
1515

@@ -140,7 +140,8 @@ let package = Package(
140140
"ProcessInfo/CMakeLists.txt",
141141
"FileManager/CMakeLists.txt",
142142
"URL/CMakeLists.txt",
143-
"NotificationCenter/CMakeLists.txt"
143+
"NotificationCenter/CMakeLists.txt",
144+
"ProgressManager/CMakeLists.txt",
144145
],
145146
cSettings: [
146147
.define("_GNU_SOURCE", .when(platforms: [.linux]))
@@ -185,7 +186,7 @@ let package = Package(
185186
"Locale/CMakeLists.txt",
186187
"Calendar/CMakeLists.txt",
187188
"CMakeLists.txt",
188-
"Predicate/CMakeLists.txt"
189+
"Predicate/CMakeLists.txt",
189190
],
190191
cSettings: wasiLibcCSettings,
191192
swiftSettings: [

0 commit comments

Comments
 (0)