Initial performance benchmarks for URL and URLComponents. Results look great, particularly between Swift 5.10 and 6.0 toolchains (old swift-corelibs-foundation vs new swift-foundation implementations). I tested on the latest Ubuntu 22.04 Swift 5.10 and nightly-6.0 images. (swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a)
From 5.10 to 6.0, we see a 5-10x speedup for almost all benchmarks, with even better outliers for URL-ParseValidASCII (29x!) and URL-ParseInvalid (94x!), as well as a whopping 254x speedup for URLComponents-GetComponentRanges (which is probably due to an implementation difference since we now store the Swift Range<String.Index> directly). These results were consistent across many runs.
I think the 29x speedup of URL(string:) for valid URL strings is the most significant improvement because that's the most common use case.
Initial performance benchmarks for
URL
andURLComponents
. Results look great, particularly between Swift 5.10 and 6.0 toolchains (oldswift-corelibs-foundation
vs newswift-foundation
implementations). I tested on the latest Ubuntu 22.04 Swift 5.10 and nightly-6.0 images. (swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a
)From 5.10 to 6.0, we see a 5-10x speedup for almost all benchmarks, with even better outliers for
URL-ParseValidASCII
(29x!) andURL-ParseInvalid
(94x!), as well as a whopping 254x speedup forURLComponents-GetComponentRanges
(which is probably due to an implementation difference since we now store the SwiftRange<String.Index>
directly). These results were consistent across many runs.I think the 29x speedup of
URL(string:)
for valid URL strings is the most significant improvement because that's the most common use case.