Files
swift-collections/Sources/PersistentCollections/PersistentDictionary/PersistentDictionary+Debugging.swift
T
Karoy Lorentey 92d1d1297e [PersistentDictionary] Add a quick&dirty memory benchmark
The new executable target `memory-benchmark` collects some memory usage statistics and outputs average memory efficiency for a range of sizes in CSV format.

Bump required toolchain version for benchmarks to Swift 5.5.
2022-09-23 16:47:30 -07:00

38 lines
1.0 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
import _CollectionsUtilities
extension PersistentDictionary {
public static var _isConsistencyCheckingEnabled: Bool {
_isCollectionsInternalCheckingEnabled
}
@inlinable
public func _invariantCheck() {
_root._fullInvariantCheck(.top, _Hash(_value: 0))
}
public func _dump(iterationOrder: Bool = false) {
_root.dump(iterationOrder: iterationOrder)
}
public static var _maxDepth: Int {
_Level.limit
}
public var _statistics: _HashTreeStatistics {
var stats = _HashTreeStatistics()
_root.gatherStatistics(.top, &stats)
return stats
}
}