code: def test_merge_opt_runtime():
      # In the original merge optimization, the following graph took
      # like caused the MERGE optimizer to exhibit really bad performance
      # (quadratic? exponential?)
      #
      # Ironically, there is actually no merging to do in this graph.
  
      x = dvector()
      r = x
      for i in range(50):
          r = r + r / 10
  
      t = time.perf_counter()
      pytensor.function([x], r, mode="FAST_COMPILE")
      # FAST_RUN does in-place optimizer which requires a lot of
      # toposorting, which is actually pretty slow at the moment.  This
      # test was designed to test MergeOptimizer... so I'm leaving
      # toposort optimizations for a later date.
      dt = time.perf_counter() - t
  
      # it should never take longer than 5 seconds to compile this graph
      assert dt < 5.0, dt
  
file_path: pytensor/tests/tensor/test_gc.py
imports: import pickle
  import time
  import numpy
  import pytest
  import pytensor
  from pytensor.compile.mode import Mode
  from pytensor.link.basic import PerformLinker
  from pytensor.link.c.basic import OpWiseCLinker
  from pytensor.tensor.type import dvector, lvector
label_desc: Use image node_id 3 for calling a global function with example usage: test_merge_opt_runtime() without return types