1107 Commits
Author SHA1 Message Date
Karoy Lorentey 8c0c0a8b49 Merge pull request #496 from cthielen/release/1.2
Include DequeModule in the Foundation toolchain build
1.2.1
2025-07-23 16:39:33 -07:00
Christopher Thielen ab46d64152 Include DequeModule in the Foundation toolchain build 2025-07-23 14:38:43 -07:00
Karoy Lorentey 96bf8b85f5 Merge pull request #486 from lorentey/BigString-easy-speedups
[BigString] Harvest some low-hanging performance fruit
2025-06-24 15:05:22 -07:00
Karoy Lorentey fc411858ee [BigString] Speed up index distance calculations
This implements a roughly 40-45% improvement for distance measurements over `BigString`’s character and Unicode Scalar views.

Interestingly, we don’t see an improvement for UTF-16 views — I’m guessing this is due to String’s breadcrumbing. (And it will go away with the upcoming UTF8Span-ification of this type.)

The benchmarks I added only show an improvement for multi-chunk big string instances, but this is merely an artifact of the specific algorithm that is being measured — for single-chunk strings, the existing measurement method is already optimal, so the new heuristic never triggers for this particular payload.
2025-06-23 15:21:40 -07:00
Karoy Lorentey f1b0eba948 [BigString] Add some basic benchmarks 2025-06-23 15:21:36 -07:00
Karoy Lorentey f02550b23f Merge pull request #485 from lorentey/fix-character-distance-1.2
[BigString] Fix character indexing operations
2025-06-23 15:19:53 -07:00
Karoy Lorentey 65f99e3eff [BigString] Fix character indexing operations
BigString sometimes miscounted distances in its character view due to alignment issues. Resolve this by overhauling distance calculations in the character metric:

- Introduce a `prefixSize` function in `_StringMetric`, distinct from `distance`.
- In the metric-agnostic index distance algorithm, use `prefixCount` to avoid double-counting characters that cross (or end on) chunk boundaries.
- Simplify `_StringMetric.distance` by requiring that `start <= end`.
- Crucially, change character-index operations to start by rounding each input index down to the nearest character break.
2025-06-17 17:28:02 -07:00
Karoy Lorentey 96a16f6dc1 [BigString] Add new tests exercising broken indexing operations 2025-06-17 17:27:58 -07:00
Karoy Lorentey c180559615 Merge pull request #476 from lorentey/v1.2-fixups
Prerelease updates
1.2.0
2025-05-16 19:05:50 -07:00
Karoy Lorentey e1be57c0f5 Also exclude Swift 5.9 on Windows 2025-05-16 18:28:02 -07:00
Karoy Lorentey 4161e4da0a Oops, fix thinko 2025-05-16 18:25:20 -07:00
Karoy Lorentey 5e3a056312 Prerelease updates 2025-05-16 16:55:09 -07:00
Karoy Lorentey 578ea312be Merge pull request #474 from lorentey/avoid-index-description
[Rope] Resolve deprecation warnings on `String.Index._description`
2025-05-16 14:06:52 -07:00
Karoy Lorentey 98697da900 Merge pull request #475 from lorentey/drop-5.9
Drop support for the Swift 5.9.* toolchains
2025-05-16 13:58:41 -07:00
Karoy Lorentey a09d7cdf45 Drop support for the Swift 5.9.* toolchains 2025-05-16 13:05:36 -07:00
Karoy Lorentey c25a388c13 [Rope] Avoid calling String.Index._description
On recent enough stdlibs, we can now just print the index directly to get the same effect.
2025-05-16 11:02:52 -07:00
Karoy Lorentey d3c6642698 Merge pull request #473 from lorentey/cherry-pick-1.2
Cherry pick recent PRs destined for 1.2
2025-05-16 01:13:44 -07:00
Karoy Lorentey d5f3b81e69 [Heap] removeAll(where:): Fix exception safety 2025-05-16 00:25:57 -07:00
Karoy Lorentey 7523978866 [Heap] Add a test for throwing midway through removeAll(where:) 2025-05-16 00:25:50 -07:00
Dakshin Devanand 027b92153b Add Heap.removeAll(where:) 2025-05-16 00:25:42 -07:00
Karoy Lorentey 60746986d8 [Heap] Fix remaining tie break inconsistency in popMax 2025-05-16 00:25:35 -07:00
Karoy Lorentey 659120d490 [Heap] Add quick tests for consistent tie breaks 2025-05-16 00:25:26 -07:00
Karoy Lorentey 6950b7e77d [Heap] Follow the spelling of stdlib’s min/max; add note explaining expectations
The existing expressions had the same effect, but they used different operators (`<=` instead of `<` and `>` instead of `>=`). The distinction is usually irrelevant, but there is no reason not to just follow what the stdlib is doing exactly.
2025-05-16 00:25:18 -07:00
Evan Wilde 4467318e2f Use full module triple for swift modules
Install swiftmodules with the full module triple expected by the
compiler instead of attempting to compute the correct architecture name
in CMake.
2025-05-16 00:24:43 -07:00
Evan Wilde bb73c1cc4a Remove CMP0091 check
CMP0091 was added in CMake 3.15. The minimum version is CMake 3.16 so
we don't need to do the check anymore.
2025-05-16 00:21:50 -07:00
3405691582andKaroy Lorentey 29cdb59bf9 Update Sources/HashTreeCollections/HashNode/_HashTreeStatistics.swift
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2025-05-16 00:21:38 -07:00
3405691582 8bbbe287c3 ManagedBuffer.capacity is unavailable on OpenBSD.
ManagedBuffer.capacity depends on malloc introspection (e.g.,
`malloc_size`), which is not available on this platform -- and is thus
marked as such.

Here, _HashNode.Storage is a ManagedBuffer. Thankfully, the uses of
.capacity are fairly limited: one for statistic purposes, which we just
completely omit on the platform, and the other, setting a minimum
capacity in the header by the buffer's .capacity; the alternative being
setting that minimum capacity directly.
2025-05-16 00:21:24 -07:00
Dakshin Devanand 0495c7b6a1 Make Heap._UnsafeHandle min/maxValue tie-breaker consistent with Swift.min/max 2025-05-16 00:19:24 -07:00
Peter Meyers 8349280c51 Add test 2025-05-16 00:16:10 -07:00
Peter Meyers 3fb4855e0e [OrderedSet] Add OrderedSet.appending(contentsOf:) 2025-05-16 00:16:00 -07:00
Karoy Lorentey f17ad98e30 Merge pull request #471 from lorentey/editorconfig
Add .editorconfig
2025-05-15 14:58:18 -07:00
Karoy Lorentey 117a1aad2d Don’t set a global tab width; indent_width is a fine default for it
Still override it to 4 in actual code with indent_size 2, in case we have stray tabs in there somewhere.
2025-05-15 14:15:30 -07:00
Karoy Lorentey b0020457d5 Merge pull request #472 from lorentey/specialize
Reimplement `_specialize(_:for:)` for the 5.9 stdlib
2025-05-15 14:10:06 -07:00
Karoy Lorentey cb7bb04262 Fix some omissions 2025-05-14 17:20:05 -07:00
Karoy Lorentey 0bd8dec08b Reimplement _specialize(_:for:) for the 5.9 stdlib 2025-05-14 16:40:25 -07:00
Karoy Lorentey 79d2904ac7 Add .editorconfig 2025-05-14 16:14:58 -07:00
Karoy Lorentey 9241bc09b9 Merge pull request #453 from apple/add-github-actions-1.2
[release/1.2] [CI] Add support for GitHub Actions
2025-03-05 16:31:22 -08:00
Mishal Shah cfbebf4c80 Drop support for Swift 5.8 2025-03-04 22:10:05 -08:00
Mishal Shah 890bcb6c6a Update the CODE_OF_CONDUCT.md to https://swift.org/code-of-conduct
(cherry picked from commit 5a152a7e33)
2025-03-04 22:05:09 -08:00
Mishal Shah 5448059189 [CI] Add support for GitHub Actions 2025-03-04 22:01:39 -08:00
Karoy Lorentey 973459e875 Merge pull request #449 from lorentey/typo-fix-1.2
[1.2][OrderedDictionary] fix a typo
2025-02-06 17:57:28 -08:00
김봉균 1cb3ca50a6 fix typo 2025-02-06 17:54:37 -08:00
Karoy Lorentey b5e880dd6a Merge pull request #446 from Steelskin/fabrice/cmake-install-paths
[cmake] Install libraries in standard directories
2025-02-06 17:51:22 -08:00
Fabrice de Gans 99db3179fc Change file names for toolchain module build
This also reverts 40adeb7, which seems to have been done in error.
2025-02-03 15:42:44 -08:00
Fabrice de Gans e0021fbb75 [cmake] Install libraries in standard directories
Previously, libs were installed under `lib/swift/${os}`. They should be
installed in the default library directory for the relevant target
system.
In addition, swiftmodules were installed in the older layout format.
This changes to use the standard modern layout format for swiftmodules.
2025-02-03 13:16:49 -08:00
Karoy Lorentey 0c11f0915a Merge pull request #447 from michael-yuji/amd64
fix amd64 support
2025-01-28 16:45:37 -08:00
Michael Chiu 40adeb7fd7 shouldnot install .swiftdoc as .swiftmodule 2025-01-27 15:13:00 -08:00
Michael Chiu 1e32c450e4 Fix amd64 support 2025-01-27 15:12:43 -08:00
Karoy Lorentey 1e6a561203 Merge pull request #433 from apple/dn-optimize-unspecialized-performance
Optimize unspecialized `OrderedSet.init` and `OrderedSet.firstIndex(of:)`
2024-11-21 16:31:49 -08:00
Karoy Lorentey 2709b96947 Minor code style updates 2024-11-18 13:59:31 -08:00