From: Michael D. <mik...@us...> - 2005-01-30 20:04:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6778/NHibernate.Test Modified Files: PerformanceTest.cs Log Message: manual ado.net uses same value of prepare_sql as config file has. Dispose of connection provider. Index: PerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PerformanceTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PerformanceTest.cs 1 Sep 2004 00:10:28 -0000 1.9 --- PerformanceTest.cs 30 Jan 2005 20:04:43 -0000 1.10 *************** *** 1,7 **** using System; - using System.Collections; using System.Data; - using NHibernate.Cfg; using NHibernate.Connection; using NHibernate.Driver; --- 1,5 ---- *************** *** 46,49 **** --- 44,48 ---- string driverClass = null; IDriver driver = null; + bool prepareSql; [SetUp] *************** *** 59,62 **** --- 58,68 ---- driver = (IDriver)Activator.CreateInstance(System.Type.GetType(driverClass)); + + string prepare = (string)cfg.Properties[ Cfg.Environment.PrepareSql ] as string; + if( prepare=="true" ) + { + prepareSql = true; + } + } *************** *** 131,135 **** System.Console.Out.Write("NHibernate: " + hiber + "ms / Direct ADO.NET: " + adonet + "ms = Ratio: " + (((float)hiber/adonet)).ToString() ); ! cp.Close(); System.GC.Collect(); } --- 137,141 ---- System.Console.Out.Write("NHibernate: " + hiber + "ms / Direct ADO.NET: " + adonet + "ms = Ratio: " + (((float)hiber/adonet)).ToString() ); ! cp.Dispose(); System.GC.Collect(); } *************** *** 205,212 **** update.Transaction = t; ! insert.Prepare(); ! delete.Prepare(); ! select.Prepare(); ! update.Prepare(); for(int i = 0; i < N; i++) --- 211,221 ---- update.Transaction = t; ! if( prepareSql ) ! { ! insert.Prepare(); ! delete.Prepare(); ! select.Prepare(); ! update.Prepare(); ! } for(int i = 0; i < N; i++) |