title: Why is max() function so much slower when comparing 2 elements vs direct comparison with an if statement?
body: <p>By running the below code I get for direct comparison with an if statement almost 4x the speed vs using the max function.</p>
  
  <p>I am trying to understand the reason behind this.</p>
  
  <p>comparison : 0.63s, max : 2.3s</p>
  
  <pre><code>import time
  
  if _name_ == '_main_':
      sim = 10**7
  
      s = time.time()
      for _ in range(sim):
          if 1 &gt; 2:
              pass
      res1 = time.time()-s
  
      s = time.time()
      for _ in range(sim):
          max(1, 2)
      res2 = time.time()-s
  
      print('comparison : {:.2}s, max : {:.2}s'.format(res1, res2))
  </code></pre>