]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
preload type affinity entries so that these comparisons don't get shoved into the...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Mar 2010 17:47:58 +0000 (17:47 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Mar 2010 17:47:58 +0000 (17:47 +0000)
test/aaa_profiling/test_compiler.py

index b5645a2415cbf720846fff066b8454826b1419aa..e49a3df7fc40a30d2efb3cd52204221089534d3d 100644 (file)
@@ -15,6 +15,16 @@ class CompileTest(TestBase, AssertsExecutionResults):
             Column('c1', Integer, primary_key=True),
             Column('c2', String(30)))
 
+        # go through all the TypeEngine
+        # objects in use and pre-load their _type_affinity
+        # entries.
+        for t in (t1, t2):
+            for c in t.c:
+                c.type._type_affinity
+        from sqlalchemy import types
+        for t in types.type_map.values():
+            t._type_affinity
+            
     @profiling.function_call_count(69, {'2.4': 44, '3.0':77, '3.1':77})
     def test_insert(self):
         t1.insert().compile()