Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions validation-test/stdlib/StringMemoryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func lowercase(_ str: String) -> String {

@inline(never)
func runTest() {
for _ in 0 ..< 10_0000 {
for _ in 0 ..< 15_0000 {
if lookup("\u{1F1E7}\u{1F1E7}", dict) {
print("Found?!")
}
Expand All @@ -63,6 +63,7 @@ runTest()
let firstRun = getMemoryUsage () - baseUsage
runTest()
runTest()
runTest()
let secondRun = getMemoryUsage () - baseUsage

// CHECK-NOT: Found?!
Expand All @@ -73,9 +74,8 @@ print("Not found")
// 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)")
}