mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The DictionaryKeysContains used unreasonably large dictionary to demonstrate the failed O(n) instead of O(1) performance in case of Cocoa Dictionary. The setup of 1M element dictionary took 8 seconds on my old machine! The old pathological behavior can be equaly well demonstrated with a much smaller dictionary. (Validated by modifying `public func _customContainsEquatableElement` in `Dictionary.swift` to `return _variant.index(forKey: element) != nil`) The reported performance with correct O(1) behavior is unchanged.
2.3 KiB
2.3 KiB