code: def benchmarkCacheHit50thKeyEqual(self):
      # If there are 50 keys and we get a new key that is equal to a key that is
      # in the cache.
  
      cache = function_cache.FunctionCache()
      args_per_call = 5
      num_total_checks = 50
  
      keys = []
      for i in range(num_total_checks):
          args = []
          for j in range(args_per_call):
              args.append(array_ops.zeros([i, j]))
          keys.append(make_type(args))
  
      for key in keys:
          cache.add(MockFunction(key, "testing"))
  
      iterations = 10000
      subtyping_time = timeit.timeit(
          lambda: cache.lookup(keys[-1]),
          number=iterations,
      )
      equality_time = timeit.timeit(
          lambda: cache.lookup(keys[-1]),
          number=iterations,
      )
  
      self.report_benchmark(
          name="cache_hit_50th_f_type_equal",
          iters=iterations,
          wall_time=subtyping_time + equality_time,
          metrics=[
              {
                  "name": "cache_hit_50th_f_type_equal_subtype_avg_ms",
                  "value": subtyping_time / iterations * 1000,
              },
              {
                  "name": "cache_hit_50th_f_type_equal_equality_avg_ms",
                  "value": equality_time / iterations * 1000,
              },
              {
                  "name": "cache_hit_50th_f_type_subtype_over_equality_ratio",
                  "value": subtyping_time / equality_time,
              },
          ],
      )
  
imports: import dataclasses
  import itertools
  import timeit
  from typing import Any, Optional
  from tensorflow.core.function import trace_type
  from tensorflow.core.function.polymorphism import function_cache
  from tensorflow.core.function.polymorphism import function_type
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import test
  from tensorflow.python.types import trace
label_desc: Use image node_id 2 for calling the FunctionCacheBenchmark obj's underlying member method code with example usage: obj.benchmarkCacheHit50thKeyEqual() without return types