Vihan Bhargava
|
cf672265c7
|
Final touch up, polishes, and optimizations.
Key Changes:
- Add duplicate handling functionality to _BTree.Builder
- Remove transient allocation in SortedDictionary.values _modify
- Add missing SortedDictionary.Values.subscript _modify
- Add SortedSet(sortedElements:)
- Add optimized SetAlgebra implementations
- Remove remaining high-level offset APIs
- Various optimizations
- Expand internal documentation
Minor Changes:
- Add ability to create dummy node
- _BTree.Builder.append(key: Key) for sets.
- Fix bug where findAnyIndex(forKey:) didn't calculate the offset.
- Remove old, unused files
- findAnyCursor -> takeCursor (to emphasize consuming nature)
- Add takeCursor(at: Index)
- Optimize init(grouping:by:) to use modifyValue to reduce CoW
Optimizations:
- Use dummy node for transient _modify state rather than allocating new buffer
|
2021-08-19 00:02:17 -07:00 |
|
Vihan Bhargava
|
0d0d66f671
|
Documentation refactors, polishes, and add SubSequences
Key Changes:
- Add custom SubSequences
- Custom SortedDictionary.(Keys|Values).Sequence iterator
- Add SortedDictionary.modifyValue(forKey:default:_:)
Minor Changes:
- Update documentation
- Various API optimizations
- Fix bug where offsetBy:limitedBy: calls did not validate indices
- Remove unique initializers with documented duplicate handling behavior.
- Implement _Node.UnsafeHandle.append*() methods
- SortedSet no longer allocates a 'values' buffer (_Node.Header.values is now optional)
Documentation:
- Complexity guarantees
- BidirectionalCollection conformances
- Sequence/IteratorProtocol methods
Optimizations:
- Add optimized dictionary value mapping (through Node.init(mappingFrom:_:))
- Custom _BTree.forEach
- Greater explicit @inline(__always) annotations throughout.
- Simplify _BTree: Sequence implementation
- Move methods to using _BTree.Builder
- _BTree.FixedSizeArray now uses `withUnsafePointer` to prevent branching.
|
2021-08-09 19:14:19 -07:00 |
|
Vihan Bhargava
|
9b470c8f92
|
Initial implementation of SetAlgebra and various refactors.
Key Changes:
- SortedSet
- Implement SetAlgebra
- Implement Hashable
- Implement Equatable
- Implement Custom(Debug)StringConvertible
- Implement CustomReflectable
- Implement Codable
- Implement subscript(range: Range<Element>)
- Implement subscript(offset:)
- Implement remove(atOffset:)
Minor Changes:
- Fix inefficiency on SortedDictionary.customMirror
- Optimize to O(1) _BTree.UnsafePath comparator
- Optimize away ARC traffic on findAnyPath(forKey:)
Various additional refactors and renames.
|
2021-08-09 19:13:50 -07:00 |
|
Vihan Bhargava
|
98f278545d
|
Continue applying refactors and optimizations.
Key Changes:
- _BTree.init() dynamically computes capacity from stride
- _BTree.UnsafePath uses Unmanaged +0 references.
Minor Changes:
- Fix _BTree.Iterator bug on single-leaf trees.
|
2021-08-09 19:13:50 -07:00 |
|
Vihan Bhargava
|
8de0b4ff7a
|
Implement primary SortedSet methods and various refactors.
Key Changes:
- SortedSet
- Implement Partial RangeReplaceableCollection
- Implement ExpressibleByArrayLiteral
- Implement init<S: Sequence>(_: S)
- Implement Set methods:
- update(with:) / insert(_:) / contains(_:)
- SortedDictionary
- Implement SortedDictionary.Values: BidirectionalCollection
- Implement SortedDictionary.Keys: BidirectionalCollection
- _BTree
- Implement Partial RangeReplaceableCollection
- Implement Sequence
- Add high performance linear iterator
Minor Changes:
- Benchmarks
- Clean up benchmarks
- _Node.UnsafeHandle
- @freeze enum InsertionResult
- _Node.Storage
- Use UnsafeMutablePointer instead of ManagedBuffer
Refactors:
- Various refactors for method signatures and documentation.
|
2021-08-09 19:13:50 -07:00 |
|
Vihan Bhargava
|
817c97a403
|
Implement initial SortedDictionary API and implementations for SortedSet.
Key Changes:
- SortedSet
- Implement BidirectionalCollection
- SortedDictionary
- Implement Codable
- Implement Partial RangeReplaceableCollection
- Includes remove*() operations
- init(grouping:by:)
- var keys: Keys (aka SortedSet<Key>)
- func (compact)mapValues(_:)
Minor Changes:
- Correct time documented complexities of various methods
- Implement more variations of removal methods.
|
2021-08-09 19:13:50 -07:00 |
|
Vihan Bhargava
|
3d5d5acb5b
|
Implement B-Tree deletion and respective tests.
Key Changes:
- Implement removal through SortedDictionary subscript
- Implement _BTree.contains for efficient existence checking
- Add tests
- _Node.UnsafeHandle.rotation/collapse tests
- _BTree.removeAny tests
- Expand benchmarks
- Add C++ reference lookup benchmarks
- Correct old benchmarks
Minor Changes:
- Remove B-Tree benchmarks, correct SortedDictionary benchmarks
- Adjust debug B-Tree printer to show both numElements and numTotalElements
- Add total count synchronization invariant check
- Implement CustomReflectable for B-Tree
|
2021-08-09 19:13:50 -07:00 |
|
Vihan Bhargava
|
9cf2cdadc0
|
Initial commit for SortedCollections
Signed-off-by: Vihan Bhargava <vihan_bhargava@apple.com>
|
2021-08-09 19:13:41 -07:00 |
|