Commit Graph

916 Commits

Author SHA1 Message Date
Xiaodi Wu
57cf4ce563 [benchmark] Add integer-to-string benchmark (#85209)
A companion to #85180.

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-11-03 11:05:26 -05:00
Aidan Hall
8632e58825 Create Pack Specialisation pass 2025-10-30 14:28:16 +00:00
Erik Eckstein
60efd32283 benchmarks: Remove the StackPromo benchmark and make it a lit test
This benchmark just wants to test if stack promotion of an array literal works.
This is so simple that it's better tested with a lit test.
2025-10-10 14:20:59 +02:00
Nate Cook
80f052e251 [stdlib] Switch to a linear-space variant of Myers diffing (#83212)
This changes the implementation for `Collection.difference(from:)` to
use a linear-space complexity variation of the same Myers algorithm. The
new version is similar in execution time to the existing one, but should
alleviate memory pressure when diffing collections where the number of
differences approaches the size of the collection. While the new
algorithm returns a set of changes that is the same size as the previous
version, the specific changes are not guaranteed to be the same.

rdar://155829876
2025-09-19 10:03:26 -07:00
Nate Cook
a14dbd2fd0 Add and enable another large diffing benchmark (#83832)
Enabling both of these despite the long runtime so that I can get an
accurate measure of the change with the new diffing implementation.
After #83212 is merged I will disable these large benchmarks again.
2025-08-21 09:23:29 -05:00
Nate Cook
a390f026b9 Add a diffing benchmark with large inputs (#83248) 2025-07-23 10:54:29 -07:00
eeckstein
22536978c2 Merge pull request #82600 from valeriyvan/WarningObjectiveCBridging
Fix unused var warning in benchmark
2025-07-01 22:49:18 +02:00
eeckstein
a3c49524a8 Merge pull request #82599 from valeriyvan/WarningDiffingMyers
Fix warning in benchmark: generic parameter 'C' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
2025-07-01 13:44:36 +02:00
Valeriy Van
b0f46de8b1 Fix unused var warning in benchmark 2025-06-28 17:48:46 +03:00
Valeriy Van
568364cd88 Fix warning
warning: generic parameter 'C' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
2025-06-28 17:45:16 +03:00
David Smith
1a56da655f Native implementation of -lengthOfBytesUsingEncoding, plus handling ASCII-subset MacRoman in a few places (#81791)
Fixes rdar://154341146
2025-06-27 13:48:10 -07:00
Stephen Canon
76df55d1aa Quiet a deprecation warning in the count(where:) benchmark (#82257)
I think the benchmarking machinery moved while count(where:) was in
limbo, so this was deprecated before the benchmark actually landed.
2025-06-17 08:58:34 -04:00
David Smith
e795eb0d13 Cache the last ObjC bridging conformance we looked up (#81545)
Fixes rdar://151475392
2025-05-16 11:00:13 -07:00
Nate Cook
e12e968570 Add contains(_:) methods to (Closed)Range (#76891)
The _StringProcessing module provides a generic, collection-based
`contains` method that performs poorly for ranges and closed ranges.
This addresses the primary issue by providing concrete overloads
for Range and ClosedRange which match the expected performance for
these operations.

This change also fixes an issue with the existing range overlap tests.
The generated `(Closed)Range.overlap` tests are ignoring the "other"
range type when generating ranges for testing, so all overlap tests
are only being run against ranges of the same type. This fixes things
so that heterogeneous testing is included.
2024-11-12 11:47:24 -08:00
David Smith
a861fc117b Add benchmarks for withContiguousStorageIfAvailable on bridged NSArrays (#75215) 2024-07-16 00:24:23 -07:00
Alexander Cyon
cb55dbbb96 Fix typo 'defne' -> 'define'. 2024-07-07 18:22:14 +02:00
Alexander Cyon
9d04bfd848 [benchmark] Fix typos 2024-07-06 13:17:13 +02:00
Karoy Lorentey
ad3d3ad045 [benchmark] Update/fix availability checks 2024-06-13 18:00:45 -07:00
David Smith
5b81405a75 Add new benchmarks for UTF16 transcoding (#74229) 2024-06-08 15:21:22 -07:00
Mykola Pokhylets
6298d41edf Reapply "Fix quadratic performance of the ListMerger in specific usage pattern"
This reverts commit 2640ff613b.
2024-05-30 13:08:42 +02:00
Andrew Trick
2640ff613b Revert "Fix quadratic performance of the ListMerger in specific usage pattern" 2024-05-21 16:23:57 -07:00
Mykola Pokhylets
69f54501d4 Added benchmark for adding jobs to default actor when visiting a tree 2024-05-10 11:05:22 +02:00
Nate Cook
38e1370884 Revert "Revert count(where:)" (#70816)
* Revert "Revert count(where:)"

This reverts commit 779ea19a6a.

Now that SE-0220 has been re-accepted, this adds the `count(where:)` 
Sequence method to the standard library.
2024-03-29 13:53:53 -05:00
Guillaume Lessard
7ed54c903c Merge pull request #71786 from oscbyspro/better-joined-distance-from-to-benchmarks
FlattenSequence/distance(from:to:) benchmarks.
2024-02-24 16:59:25 -08:00
Oscar Byström Ericsson
8cfbb62a2e FlattenSequence/distance(from:to:) benchmarks (v7).
The benchmarks took too long to perform, so I reduced the size of each payload.
2024-02-24 08:18:33 +01:00
Oscar Byström Ericsson
7ecb987ad5 FlattenSequence/distance(from:to:) benchmarks (v6).
1. The auto-generated [BenchmarkInfo] was given the wrong name.
2024-02-23 10:11:18 +01:00
Oscar Byström Ericsson
cef7c43daf FlattenSequence/distance(from:to:) benchmarks (v5).
1. Replaced occurrences of Repeated<T> with Array<T>.
2024-02-22 20:45:03 +01:00
Oscar Byström Ericsson
dff27479bf FlattenSequence/distance(from:to:) benchmarks (v4).
1. Added some sequential tests with String as the inner collection.
2024-02-22 17:31:28 +01:00
Oscar Byström Ericsson
6829f808a0 FlattenSequence/distance(from:to:) benchmarks (v3).
1. Parameterized benchmark dependencies, per code review.
2024-02-22 17:25:29 +01:00
Oscar Byström Ericsson
0ea89852da FlattenSequence/distance(from:to:) benchmarks (#71648). 2024-02-21 17:33:30 +01:00
David Smith
f1feba0e42 Eytzingerize word break data (#71731)
Switch word break property searching to Eytzinger binary search
2024-02-20 22:49:34 -08:00
Tim Kientzle
dc7a3d38cd Fix HTTP2StateMachine benchmark
The optimizer managed to eliminate this entire benchmark,
resulting in useless 0 second timings.

I made a couple of changes to ensure the optimizer cannot
eliminate the loop:
* The individual checks now actually use the loop parameter
* `identity()` is used to ensure conservatism

While here, I reduced the loop count since these benchmarks seem
to run for a long time.
2023-09-22 17:50:51 -07:00
Manu
02b5fa2c8e Fix some typos in the codebase 2023-08-31 18:50:10 -03:00
Max Desiatov
21a2b78801 stdlib/benchmark: add canImport(Musl) where needed (#67120)
This allows compiling stdlib and benchmarks when targeting musl instead of Glibc.
2023-07-05 19:55:08 +01:00
Lucy Satheesan
32745c3c56 [benchmark] half Array.removeAll bench size 2023-05-23 21:10:11 -07:00
Lucy Satheesan
6a1129f68a [benchmark] rename Array.removeAll benchmarks 2023-05-23 17:10:32 -07:00
Lucy Satheesan
008ed2fa95 [benchmark] clean up setup for ArrayRemoveAll 2023-05-23 14:14:14 -07:00
Lucy Satheesan
d489ba2740 [benchmark] check results only once in ArrayRemoveAll 2023-05-23 11:22:47 -07:00
Lucy Satheesan
51c62aee19 [benchmark] add removeAll(keepingCapacity: true) non-unique test 2023-05-23 11:05:59 -07:00
David Smith
4d3c75631e Wow, even further I guess 2023-05-12 17:22:08 -07:00
David Smith
708c5c4381 Nah let's go a little lower 2023-05-12 16:31:08 -07:00
David Smith
92bba63159 Ok I think this should be right 2023-05-12 16:29:23 -07:00
David Smith
a63031c636 Scale benchmark down… 2023-05-12 15:39:12 -07:00
David Smith
b024a560ed Fix thinko, thank you Nate! 2023-05-12 14:14:53 -07:00
David Smith
4f363f72f1 Try to thwart the optimizer 2023-05-10 10:55:37 -07:00
David Smith
d5d97ad26e Further benchmark scaling 2023-05-10 02:31:03 -07:00
David Smith
0ddc90b355 Further benchmark scaling 2023-05-10 01:25:38 -07:00
David Smith
71ed988d27 Scale benchmarks 2023-05-09 16:29:56 -07:00
David Smith
7d234d76ea More build fixes 2023-05-09 13:50:41 -07:00
David Smith
6cb9e5cfdd Build fixes 2023-05-09 11:27:04 -07:00