title: Strange overhead from python function call
body: <p>I have some strange overhead coming from nowhere. I'm running a python script and making some SQL queries using SQLAlchemy. Here is my problem:</p>
  
  <pre><code>def _create_connection(name):
      connection = get_connection(name)
      cstring = "mysql+mysqldb://login:passwd@host/database?charset=utf8"
      return create_engine(cstring)
  
  def _get_table(engine, table):
      metadata = MetaData(engine)
      return Table(table, metadata, autoload=True)
  
  class A(object):
      def requests_statuses(self, user_id):
          friendship_request_t = _get_table(self._db, "friendship_request")
          user_t = _get_table(self._db, "user")
  
          a = datetime.now()
  
          s = select([user_t.c.user_id, friendship_request_t.c.status],
                     from_obj=[friendship_request_t.join(
                      user_t,
                      friendship_request_t.c.user_id_a==user_t.c.user_id)]).\
              where(friendship_request_t.c.user_id_b==bindparam('fr_user_id_b'))
          results = self._db.execute(s, fr_user_id_b=user_id).fetchall()
  
          b = datetime.now()
  
          print "interval: " + unicode(b - a)
  
          return results
  
  class B(object):
      def friend_requests_statuses(self):
          a_obj = A()
  
          print "begin: " + unicode(datetime.now())
          results = a_obj.requests_statuses(self.id)
          print "end  : " + unicode(datetime.now())
  </code></pre>
  
  <p>When running this program:</p>
  
  <pre><code>b_obj = B()
  b.friend_requests_statuses()
  </code></pre>
  
  <p>I have this output:</p>
  
  <pre><code>begin: 2013-02-07 18:57:40.058834
  interval: 0:00:00.001852
  end  : 2013-02-07 18:57:40.076525
  </code></pre>
  
  <p>I have a 16ms overhead. The SQL query just took 1.8ms to execute.</p>
  
  <p>Can someone help me please?</p>
  
  <p>Is it possible that the 'overhead' comes from garbage collecting when exiting A.requests_statuses method?</p>