[SR-10709] Swift needs allocation counter tests #53106
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: 0485647f5ac3a9e0b2ad81bf53a22c91
relates to:
Issue Description:
Frequently we see Swift regressions in allocations that get introduced in by newer Swift versions in the SwiftNIO allocation counter tests or by just manually debugging things. This is quite costly and Swift should IMHO have their own allocation counter tests that make sure allocations from certain pieces of code only ever go down.
Examples:
https://bugs.swift.org/browse/SR-10708
https://bugs.swift.org/browse/SR-10682
https://bugs.swift.org/browse/SR-10604
https://bugs.swift.org/browse/SR-10346
https://bugs.swift.org/browse/SR-10028
https://bugs.swift.org/browse/SR-10708
https://bugs.swift.org/browse/SR-11231
SwiftNIO examples:
the allocation counter framework: https://github.com/apple/swift-nio/tree/master/IntegrationTests/allocation-counter-tests-framework
how you'd run it for a given SwiftPM package: https://github.com/apple/swift-nio/blob/master/IntegrationTests/tests_04_performance/test_01_resources/run-nio-alloc-counter-tests.sh
example test case: https://github.com/apple/swift-nio/blob/master/IntegrationTests/tests_04_performance/test_01_resources/test_future_lots_of_callbacks.swift
configured limits in our CI: https://github.com/apple/swift-nio/blob/master/docker/docker-compose.1804.50.yaml#L28-L38
the guts are here: https://github.com/apple/swift-nio/blob/master/IntegrationTests/allocation-counter-tests-framework/template/HookedFunctionsDoHook/Sources/HookedFunctions/src/hooked-functions.c
The text was updated successfully, but these errors were encountered: