<commit_before>//===--- TypeFlood.swift --------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import TestsUtils
protocol Pingable {}

struct Some1<T> {
  init() {}
  func foo(x: T) {}
}
struct Some0<T> {
  init() {}
  func foo(x: T) {}
}

@inline(never)
func flood<T>(x : T) {
  Some1<Some1<Some1<Some1<T>>>>() is Pingable
  Some1<Some1<Some1<Some0<T>>>>() is Pingable
  Some1<Some1<Some0<Some1<T>>>>() is Pingable
  Some1<Some1<Some0<Some0<T>>>>() is Pingable
  Some1<Some0<Some1<Some1<T>>>>() is Pingable
  Some1<Some0<Some1<Some0<T>>>>() is Pingable
  Some1<Some0<Some0<Some1<T>>>>() is Pingable
  Some1<Some0<Some0<Some0<T>>>>() is Pingable
  Some0<Some1<Some1<Some1<T>>>>() is Pingable
  Some0<Some1<Some1<Some0<T>>>>() is Pingable
  Some0<Some1<Some0<Some1<T>>>>() is Pingable
  Some0<Some1<Some0<Some0<T>>>>() is Pingable
  Some0<Some0<Some1<Some1<T>>>>() is Pingable<commit_msg>Add a short description to the benchmark.<commit_after>//===--- TypeFlood.swift --------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// We use this test to benchmark the runtime memory that Swift programs use.
//
// The Swift compiler caches the metadata that it needs to generate to support
// code that checks for protocol conformance and other operations that require
// use of metadata.
// This mechanism has the potential to allocate a lot of memory. This benchmark
// program generates 2^15 calls to swift_conformsToProtocol and fills the
// metadata/conformance caches with data that we never free. We use this
// program to track the runtime memory usage of swift programs. The test is
// optimized away in Release builds but kept in Debug mode.


import TestsUtils
protocol Pingable {}

struct Some1<T> {
  init() {}
  func foo(x: T) {}
}
struct Some0<T> {
  init() {}
  func foo(x: T) {}
}

@inline(never)
func flood<T>(x : T) {
  Some1<Some1<Some1<Some1<T>>>>() is Pingable
  Some1<Some1<Some1<Some0<T>>>>() is Pingable
  Some1<Some1<Some0<Some1<T>>>>() is Pingable
  Some1<Some1<Some0<Some0<T>>>>() is Pingable
  Some1<Some0<Some1<Some1<T>>>>() is Pingable
  Some1<Some0<Some1<Some0<T>>>>() is Pingable
  Some1<Some0<Some0<Some1<T>>>>() is Pingable
  Some1<Some0<Some0<Some0<T>>>>() is Pingable
  Some0<Some1<Some1<Some1<T>>>>() is Pingable
  Some0<Some1<Some1<Some0<T>>>>() is Pingable
  Some0<Some1<Some0<Some1<T>>>>() is Pingable
  Some0<Some1<Some0<Some0<T>>>>() is Pingable
  Some0<Some0<Some1<Some1<T>>>>() is Pingable
{'fraction_non_alphanumeric': 0.2213139570087799, 'fraction_numerical': 0.03966091432031486, 'mean_word_length': 3.1145703611457036, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6599095', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1079, 'n_words': 313}