Subject [IBO] Re: DataSetProvider, ClientDataSet performance
Author constantijnw
Indeed, IBO is significantly slower than IBX in this context, roughly
about 5 times on my machine connecting locally to employee.gdb and
querying the employee table.
Connection and prepare times are not included.

Measuring at the level of the client dataset, or at the query/dataset
components does not make much difference.
One could argue that you can't compare a query component and a dataset
component, but I didn't notice any performance difference between both
IBX components.
I also checked IB_Cursor, and it was still 50% slower than IBX.

What sql servers do you use? IB, FB or both? You could get into
trouble using IBX with FB.
From what you wrote I don't know if you're working on a multi-tier app
or that you use the client dataset for its special features and/or
future upscaling.
Since I work on a multi-tier app I design clients very differently. I
was surprised to see how much you can gain by rethinking every byte
you intend to pull over the network carefully. And the outcome is that
responsiveness is so good that users wouldn't notice any difference
when using another taste of components. Nevertheless, as a designer it
would be great to know you're working with the fastest option
possible. I hope Jason will come up with a component optimized for
response time of selects of relatively small datasets soon.


--- In IBObjects@yahoogroups.com, "Glenn Stephens"
<Glenn.Stephens@a...> wrote:
> Hi Constantijn,
>
> Thanks for answering.
>
> I'm not using the CommandText property. I am using the SQL property in
> the TIBOQuery. What I want to demonstrate is the difference in the speed
> of obtaining data. Paste the dfm code at the bottom of the email to your
> form. Change the Database name and the SQL to a database/table on your
> system for both of the databases. Now set the ClientDataSet on the left
> side (IBO) to true and count how long it takes in seconds. Now do the
> same with the ClientDataSet on the right.
>
> I counted to 21 for IBO objects code on the left and got to 1 for the
> IBX components.
>
> Any ideas here? I don't really want to move a lot of the code to IBX.
>
> Cheers,
> Glenn
>
> ---Paste the code below to your form or datamodule---
>
>
> object IB_Session1: TIB_Session
> AllowDefaultConnection = True
> AllowDefaultTransaction = True
> DefaultConnection = IB_Connection1
> EditingColor = clYellow
> InsertingColor = clLime
> DeletingColor = clRed
> SearchingColor = clAqua
> ReadOnlyColor = clSilver
> SelectedColor = clBlue
> InvalidColor = clNone
> PreparedColor = clGrayText
> BrowsingColor = clWindow
> StoreActive = False
> Left = 144
> Top = 72
> end
> object IB_Connection1: TIB_Connection
> DefaultTransaction = IB_Transaction1
> Params.Strings = (
> 'SERVER=myserver'
> 'PATH=e:\data\mydata.ib'
> 'PROTOCOL=TCP/IP'
> 'USER NAME=SYSDBA')
> Left = 80
> Top = 152
> end
> object IB_Transaction1: TIB_Transaction
> IB_Connection = IB_Connection1
> Isolation = tiConcurrency
> Left = 208
> Top = 152
> end
> object IBOQuery1: TIBOQuery
> Params = <>
> DatabaseName = 'myserver:e:\data\mydata.ib'
> IB_Connection = IB_Connection1
> RecordCountAccurate = True
> SQL.Strings = (
> 'select * from MYTABLE')
> FieldOptions = []
> Left = 144
> Top = 216
> end
> object DataSetProvider1: TDataSetProvider
> DataSet = IBOQuery1
> Left = 144
> Top = 296
> end
> object ClientDataSet1: TClientDataSet
> Aggregates = <>
> Params = <>
> ProviderName = 'DataSetProvider1'
> Left = 144
> Top = 368
> end
> object IBDatabase1: TIBDatabase
> DatabaseName = 'myserver:e:\data\mydata.ib'
> Params.Strings = (
> 'user_name=sysdba'
> 'password=masterkey')
> LoginPrompt = False
> DefaultTransaction = IBTransaction1
> IdleTimer = 0
> SQLDialect = 1
> TraceFlags = []
> Left = 392
> Top = 152
> end
> object IBTransaction1: TIBTransaction
> Active = False
> DefaultDatabase = IBDatabase1
> AutoStopAction = saNone
> Left = 520
> Top = 152
> end
> object IBQuery1: TIBQuery
> Database = IBDatabase1
> Transaction = IBTransaction1
> BufferChunks = 1000
> CachedUpdates = False
> SQL.Strings = (
> 'select * from MYTABLE')
> Left = 464
> Top = 224
> end
> object DataSetProvider2: TDataSetProvider
> DataSet = IBQuery1
> Left = 464
> Top = 296
> end
> object ClientDataSet2: TClientDataSet
> Aggregates = <>
> Params = <>
> ProviderName = 'DataSetProvider2'
> Left = 464
> Top = 368
> end