Skip to content

Conversation

@lorentey
Copy link
Member

@lorentey lorentey commented Aug 6, 2024

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

jmschonfeld and others added 10 commits June 18, 2024 15:09
* Eliminate relative paths from the cmake single-module build

* Attempt to reduce length of paths in single module build
When ingesting a `String` instance, `BigString` assumes that the input string has a reasonably efficient UTF-8 view.

Unfortunately, that is very much not the case when the input happens to be backed by a bridged NSString object — it appears that in this case, the ingester loop invokes some operation(s) with linear complexity in the size of the entire input, rendering the ingester’s overall complexity quadratic.

The BigString ingester is only expected to operate within a single chunk at the time. It’s unclear precisely which operation triggers the quadratic behavior; ideally we should figure it out and resolve it with a more targeted fix.

In the meantime, a blunt stopgap fix is to force-transcode the input string to UTF-8 at the time the ingester is initialized. This unnecessarily wastes some (temporary) memory on holding the transcoded string, but it avoids the quadratic cliff.
…ing-init

[BigString] Fix accidentally quadratic `BigString.init`
To repair the swift-corelibs-foundation build on WebAssembly, we need to
add support for Wasm targets to swift-collections' CMake build system.
[CMake] Add support for WebAssembly target architectures
@lorentey
Copy link
Member Author

lorentey commented Aug 6, 2024

@swift-ci test

@lorentey lorentey merged commit 11433b6 into apple:main Aug 6, 2024
@lorentey lorentey deleted the merge-release-1.1→main branch August 6, 2024 03:42
@lorentey lorentey added this to the 1.3.0 milestone Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants