Not to put CF more down than I usually do, but what I just found out
_really_ surprised me.

Calling ADO through CFOBJECT is 20% faster than CFQUERY !!!

Test it yourself at http://dev.aylo.com/testing/Perf/db.cfm

My question, what does CFQUERY use to access ODBC ? Would anyone be
interested in using a <CF_ADO name=myrs datasource=myconn>select
query</CF_ADO> tag that we are currently working on ?

Here's the url's code:
<cfsetting showdebugoutput="yes">
<cfparam name="times" default=100>
<cfparam name="lang" default="">
<cfoutput>
<form action=db.cfm method=post>Loops: <input size=4 name=times
value="#times#"><br><input type=submit name=lang value="CFQUERY"><input
type=submit name=lang value="ADO"></form><hr>
</cfoutput>
<cfset startat = gettickcount()>
<cfif lang IS "CFQUERY">
        <cfloop from="1" to="#times#" index=i>
                <cfquery name="licenses" datasource="FusionLicenser">
                select * from licenses
                </cfquery>
        </cfloop>
        <cfset endat = gettickcount()>
        <cfoutput>#times# recordsets containing #licenses.recordcount# records
pulled in #numberformat(evaluate(endat-startat))# ms.</cfoutput>
<cfelseif lang IS "ADO">
        <CFOBJECT TYPE="COM" NAME="conn" CLASS="ADODB.Connection"
ACTION="CREATE">
        <cfset isopen = conn.Open("FusionLicenser","","",-1)>
        <cfloop from="1" to="#times#" index=i>
                <CFOBJECT TYPE="COM" NAME="rs" CLASS="ADODB.Recordset"
ACTION="CREATE">
                <cfset tmp = rs.Open("select * from licenses", conn,1,1,1)>
        </cfloop>
        <cfset endat = gettickcount()>
        <cfoutput>#times# recordsets containing #rs.recordcount# records pulled
in #numberformat(evaluate(endat-startat))# ms.</cfoutput>
        <cfset conn = "">
</cfif>

Dave Watts wrote:
> 
> > ODBC certainly isn't anywhere near native SQL support - it is
> > a generic middleware datasource driver - and although OLEDB is
> > closer, it still isn't native SQL. OLEDB drivers are available
> > for numerous applications including the Access Jet Engine just
> > like ODBC.
> >
> > Nearer to native still would be be by using the SQL DB-LIB
> > API for CF to talk to SQL Server.
> 
> Microsoft provides lots of APIs to connect to databases (DB-Library, RDO,
> ADO, etc), but none of these is more "native" than OLEDB. Native doesn't
> necessarily mean lowest-level, it means the method that the vendor defines
> as native. Microsoft has declared this to be OLEDB. If you use the data
> transfer tools inside of Enterprise Manager, you'll connect via OLEDB. The
> fact that OLEDB providers are available for other platforms is also
> unimportant.
> 
> After all, if you look at native drivers for other platforms, you face the
> same availability of alternatives. If you connect natively to Oracle 8i, CF
> simply communicates directly with the Net8 client, which itself is analogous
> to OLEDB. I'd guess that the SQL Plus client talks at a lower level than
> Net8. When you connect to SQL Server 7 using ODBC, CF talks to ODBC, which
> talks to OLEDB. Using OLEDB instead of ODBC cuts out the middleman, so to
> speak.
> 
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> voice: (202) 797-5496
> fax: (202) 797-5444
> 
> ------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

-- 
Aymeric Grassart        <->     Chief Technology Officer
http://www.aylo.com     <->     Aylo Inc.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to