36 Commits
Author SHA1 Message Date
Karoy Lorentey d45e63421d [Deque][NFC] Remove unused code (#49) 0.0.3 2021-05-27 20:08:42 -07:00
Karoy Lorentey 3358c448bf [meta] Update dependencies (#48)
(This only affects local development.)
2021-05-27 19:48:12 -07:00
Karoy Lorentey b0aa6a55d6 [manifest] Ignore CMake files (#47)
The package manager doesn’t like it when it finds unexpected non-source files in source directories.
2021-05-27 19:43:58 -07:00
Karoy Lorentey de5f1e6061 [Deque] Work around stdlib issue with Array.withContiguousStorageIfAvailable (#44)
Resolves #27.
2021-05-27 18:59:45 -07:00
Saleem Abdulrasool 4d73202c18 git: ignore vim swap files (#41) 2021-05-24 17:45:07 -07:00
Saleem Abdulrasool 689c485dfe build: add a CMake based build system (#42)
Add a CMake based build system to enable bootstrapping the toolchain
with the ability to use Swift Collections in SPM.
2021-05-21 19:54:59 -07:00
Vihan fcb788c79b Add Xcode template file with license comment. (#40) 2021-05-20 20:30:39 -07:00
Karoy Lorentey f1f0fa8e03 Remove the benchmark product from the package manifest (#36) 2021-05-12 09:02:35 -07:00
François Lamboley f6d8f82627 Replace Index with Int where possible (#32) 2021-05-10 16:36:10 -07:00
Saleem Abdulrasool b91621e0fc Documentation: remove invalid file characters (#34)
`:` is not supported on Windows as a valid file name character.  Replace
the `:` with `-`.
2021-05-10 10:46:22 -07:00
Michael Steindorfer fe745fc2e8 [OrderedCollections] Correct spelling of BitsetTests filename (#29) 2021-04-29 20:19:51 -07:00
Karoy Lorentey 65a38419d0 [OrderedDictionary] Document encoding format (#26)
Unlike the regular unordered `Dictionary`, `OrderedDictionary` always encodes/decodes itself as alternating key/value pairs in an unkeyed container. Document this fact (and the reason behind it) in the `Decodable` implementation.
2021-04-16 15:59:00 -07:00
Karoy Lorentey 3fb3c754a6 Update to swift-collections-benchmark 0.0.2 (#25) 2021-04-16 15:42:26 -07:00
Abin Tom 14299b8d79 Fix CollectionTestCase calling super setup on tearDown (#23)
Fixes issue https://github.com/apple/swift-collections/issues/17
2021-04-13 19:32:10 -07:00
Kiel Gillard 0096c5b39d Add the @discardableResult attribute to OrderedSet.insert(_:at:) (#21)
* Add the @discardableResult attribute to OrderedSet.insert(_:at:). Fixes #19

* Add the @discardableResult attribute to OrderedSet.updateOrAppend(_).

* Add the @discardableResult attribute to OrderedSet.updateOrInsert(_:at:).
2021-04-13 19:03:56 -07:00
Karoy Lorentey d2395c5443 [meta] Update links in PR templates (#10) 2021-04-12 11:28:18 -07:00
Karoy Lorentey 2d719d75a2 Fix nondeterministic compiler crash in debug builds (#18)
So as it turns out, the Swift compiler’s MergeModules phase (which SwiftPM uses in Debug builds) has a known issue with dependency cycles between separate source files — it rarely triggers, but when it does, swiftc hits an assertion complaining about a deserialization failure.

The v0.0.1 of Swift Collections happens to include such a cycle, but it only triggers the assertion on a small fraction of machines. I don’t yet know what exactly makes it nondeterministic, but it is reproducible by randomly reshuffling the source filenames of the OrderedSet implementation — a couple dozen randomizations will eventually lead to a state where it happens in every build.

The workaround is to put OrderedSet’s Sequence and RandomAccessCollection conformances in the same file. (OrderedSet uses the standard IndexingIterator, which requires a Collection conformance, while Collection itself refines Sequence — I believe this is the dependency cycle that is causing all this problem.)

Unfortunately, until we figure out what triggers the nondeterminism (or until the MergeModules action is replaced with something that actually, you know, works, this issue may keep randomly reoccurring. None of this makes much sense, but here we are. 😝
0.0.2
2021-04-10 00:17:50 -07:00
Karoy Lorentey ff7363299e Update Xcode schemes for the package 2021-04-09 18:48:29 -07:00
Todd Pressley 62c3a3a18e Correct typo for address sanitizer 2021-04-09 02:35:27 -07:00
Karoy Lorentey 9492a283e7 Merge pull request #6 from numist/numist/ordered-set-diffing
Efficient diffing for OrderedSet
2021-04-08 23:10:10 -07:00
James Power acdb003117 Fixes link to combinatorics. 2021-04-08 22:56:22 -07:00
Alexander Cyon d19229af04 Update Package.resolved with swift-collections-benchmark package 2021-04-08 22:50:36 -07:00
Karoy Lorentey 5a2a6841fd Update OrderedSet+ReserveCapacity.swift 2021-04-08 15:40:08 -07:00
Franklin Byaruhanga 33e648229c Fixed invalid link to Contribution Guidelines
Fixed invalid link to Contribution Guidelines for new pull requests templates

Signed-off-by: Franklin Byaruhanga <byaruhaf@appbantu.com>
2021-04-06 16:46:04 -07:00
Franklin Byaruhanga b68a025e23 Minor Fix in documentation for function OrderedDictionary.updateValue
Signed-off-by: Franklin Byaruhanga <byaruhaf@appbantu.com>
2021-04-06 16:46:04 -07:00
Scott Perry 956ea437df Update complexity in headerdoc to match implementation (and simplify per big-O rules) 2021-04-06 09:49:06 -07:00
Scott PerryandKaroy Lorentey 9ffceb3878 Use elements to manifest an Array from an OrderedSet
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2021-04-06 07:44:35 -07:00
Scott Perry 7b37f7892b Add benchmarks and clean up headerdoc 2021-04-05 20:57:32 -07:00
Scott Perry fcaad7a824 Myers worst case performance tests 2021-04-05 20:29:17 -07:00
Scott Perry d3ab8e8536 Performance testing and diff size checks, along with fuzzer test demonstrating greedy minimalism tradeoff 2021-04-05 20:24:22 -07:00
Scott Perry 7401c23c18 Basic implementation of OrderedSet.applying() balancing performance with code complexity 2021-04-05 19:19:28 -07:00
Scott Perry c71b73954e Match style 2021-04-05 19:07:03 -07:00
Scott Perry ed375766aa Initial implementation of diffing (and tests!) for OrderedSet 2021-04-05 18:35:23 -07:00
Karoy Lorentey bd924007a2 Add the benchmarking config used in the announcement post on swift.org 0.0.1 2021-04-05 09:41:00 -07:00
Karoy Lorentey 68609682e0 Remove Uniqued<Base>
This type was one of the prototypes for `OrderedSet` — it allowed us to customize the collection type used for element storage. (E.g., using `Deque` instead of `Array` to get efficient insertions at the front.) The original idea was that `OrderedSet` would simply be a typealias:

```swift
typealias OrderedSet<Element> = Uniqued<Array<Element>>
```

Unfortunately, while this concept is intellectually pleasing, in practice it just made the interface more complicated (and, in some cases, slower). Worse, it cannot be directly translated to an `OrderedDictionary`-style key-value mapping without major usability problems.

# Conflicts:
#	Package.swift
2021-04-05 09:41:00 -07:00
Karoy Lorentey a2bcac435f Initial import.
Introduce OrderedCollections module
2021-04-05 09:41:00 -07:00