@Profiler.profile
def test_flush_no_pk(n):
 session = Session(bind=engine)
 for chunk in range(0, n, 1000):
  session.add_all([Customer(name=('customer name %d' % i), description=('customer description %d' % i)) for i in range(chunk, (chunk + 1000))])
  session.flush()
 session.commit()

@ Profiler . profile def test_flush_no_pk ( n ) : session = Session ( bind = engine ) for chunk in range ( 0 , n , 1000 ) : session . add_all ( [ Customer ( name = ( 'customer name %d' % i ) , description = ( 'customer description %d' % i ) ) for i in range ( chunk , ( chunk + 1000 ) ) ] ) session . flush ( ) session . commit ( )
individual insert statements via the orm .