Subject FieldByName, ParamByName, Performance ???
Author rj@oikossw.de
Hi,

i am new to IBO and porting an existing
and i have got slight performance problems
using TIB_DSQL and ParamByName and
TIB_Cursor FieldByName

using ParamByName my application is about five times
slower as if i use Params[idx].

the (pseudo) code i am using:

ibDSQL := TIB_DSQL.Create(self);
ibDSQL.IB_Connection := Connection;
ibDSQL.BeginBusy(true);
MemTable.DisableControls;
MemTable.First;
ibDSQL.SQL.Add('insert into tablename ( col1, col2, col3, ...,
col10)');
ibDSQL.SQL.Add('values (:col1, :col2, ..., :col10)');
ibDSQL.Prepare;
while not MemTable.EOF do
begin
ibDSQL.ParamByName('col1').AsString := MemTableCol1.AsString;
...
ibDSQL.ParamByName('col10').AsFloat:= MemTableCol1.AsFloat;
MemTable.Next;
end;
ibDSQL.BeginBusy(true);
MemTable.GotoBookmark(bm);
MemTable.EnableControls;

the alternative would be:

ibDSQL.Params[0].AsString := MemTableCol1.AsString;
...
ibDSQL.Params[9].AsFloat := MemTableCol1.AsFloat;


i observe a similar behaviour with TIB_Cursor, TIB_Query and
FieldByName. I am a bit suspicious, that I misuse the IBO-Library
since the corresponding Method (TIB_Row.GetByName) does not look
slow and there is nearly no difference in Runtime between
ParamByName and Params[idx] in IBX. By the way: IBO and Params[idx]
is faster :)

any tips ?

Thanks a lot ...

Ralph