Files
swift-mirror/benchmark/single-source/DictionaryKeysContains.swift
Pavol Vaskovic bfbff45727 [benchmark] Downsized DictionaryKeysContains
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.
2018-10-27 07:34:33 +02:00

2.3 KiB