Merge pull request #23325 from aschwaighofer/improve_string_memory_test-5.0
[5.0] Improve StringMemoryTest.swift
diff --git a/validation-test/stdlib/StringMemoryTest.swift b/validation-test/stdlib/StringMemoryTest.swift
index 5de9bdb..996b0eb 100644
--- a/validation-test/stdlib/StringMemoryTest.swift
+++ b/validation-test/stdlib/StringMemoryTest.swift
@@ -40,7 +40,7 @@
@inline(never)
func runTest() {
- for _ in 0 ..< 10_0000 {
+ for _ in 0 ..< 15_0000 {
if lookup("\u{1F1E7}\u{1F1E7}", dict) {
print("Found?!")
}
@@ -63,6 +63,7 @@
let firstRun = getMemoryUsage () - baseUsage
runTest()
runTest()
+runTest()
let secondRun = getMemoryUsage () - baseUsage
// CHECK-NOT: Found?!
@@ -73,9 +74,8 @@
// CHECK: success
// CHECK-NOT: failure
-// We should not need 50MB for this.
-if firstRun * 2 < secondRun {
- print("failure - should not linearly increase")
+if firstRun * 3 < secondRun && firstRun > 10_000 {
+ print("failure - should not linearly increase firstRun: \(firstRun) secondRun: \(secondRun)")
} else {
- print("success")
+ print("success firstRun: \(firstRun) secondRun: \(secondRun)")
}