Subject Re: [IBO] development
Author Hans
Hello Jason,

As requested I performed all the requested tests with a greatly in size
reduced database

IBOjects:
Test 1:
15:30:28.500 DataPumping using IBObjects
15:30:28.500 Using two IB_Cursors
15:32:40.406 Database Maint Completed in 124.579 Secs

Test 2:
15:38:47.500 DataPumping using IBObjects
15:38:47.500 Using Begin/End Busy
15:38:47.500 Using two IB_Cursors
15:40:47.125 Database Maint Completed in 111.734 Secs

Test 3:
15:41:11.015 DataPumping using IBObjects
15:41:11.015 Using IB_DataPump (Yield = False)
15:43:09.953 Database Maint Completed in 111.578 Secs

Test 4:
15:44:31.875 DataPumping using IBObjects
15:44:31.875 Using Begin/End Busy
15:44:31.875 Using IB_DataPump (Yield = False)
15:46:24.953 Database Maint Completed in 105.687 Secs

FIBPlus:

15:22:27.718 DataPumping using FIBPlus
15:22:27.718 Using two tpFIBDataSets
15:22:48.843 Database Maint Completed in 13.812 Secs

Sorry to disappoint you :)

Source Code available upon request, which consists of a 6 line assign loop
or a one line IB_DataPump.Execute
plus some bookkeeping.

Best Regards
Hans


----- Original Message -----
From: "Jason Wharton" <supportlist@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, March 21, 2010 8:41 AM
Subject: Re: [IBO] development


> Hans,
>
>> Hi, I wish to share my concern.
>>
>> I just wanted to copy all tables and contents from one 128M test database
>> to
>> another database and used some IB_Cursors to loop throught the table
>> names
>> and the fields
>> update loop like:
>>
>> with IB_Cursor_Old do
>> begin
>> IB_Cursor_New.Append;
>> for i := 0 to FieldCount - 1 do
>> IB_Cursor_New.Fields[i].Assign(IB_Cursor_Old.Fields[i]);
>> IB_Cursor_New.Post;
>>
>> Then I downloaded a test copy of FIBPlus 6.5, which seems to be designed
>> for
>> many
>> platforms and all Delphi versions from 5 and up, and merely replaced the
>> IB_Cursors with
>> their tpFIBDataset, for the rest using the almost identical coding as I
>> used
>> for IBObjects.
>>
>> Using Firebird 2.1.3 on the same computer as the copying tests, creating
>> identical results,
>> using basic objects in a very basic way
>>
>> The total run time using IBOjects 4.8.4 was 32 Mins and 35 Secs (1955
>> Secs)
>> The total run time using FIBPlus 6.5 was 1 Min and 32 Secs
>> ( 92
>> Secs)
>>
>> FIBPlus about 21+ times faster than IBObjects.
>>
>> My concern, as a long time supporter of IBObjects since the early
>> versions
>> V3.xx,
>> is the IBObject development going in the right direction ?
>
> Yes, it most definitely is.
>
> You need to call the BeginBusy() and EndBusy methods when you are doing
> these kinds of things.
>
> Your performance will increase dramatically. This has been a documented
> and
> heavily discussed aspect for a long time.
>
> In short, you avoid all of the overhead of what it takes for IBO to go to
> the trouble of informing the system that the database is now actively
> engaged in processing. This involves changing the status of the screen
> cursor, among other things.
>
> Also, using the Assign() method involves additional overhead. The precise
> behavior for this method requires that the original contents of the two
> colums involved be compared and other dataset level flags be adjusted so
> that the Modified property is only registering a change if there is an
> actual change in content. Obviously, this is not of concern since you are
> just processing data in a straight forward manner and not looking for
> these
> finer distinctions to work correctly.
>
> In short, there is much that SHOULD be done in order to have a technically
> precise means of interacting with your data that FIBPlus does NOT do. Of
> course this results in greater performance, but all of that performance is
> YET available in IBO if you learn to use it correctly while you maintain
> the
> far superior technical accuracy in the interactions with your data.
>
> Also, the most appropriate way to do this in IBO is to use the
> TIB_DataPump.
> I suggest you give that component a go and then come back with your
> benchmark results. You will find that IBO's performance will be better
> than
> FIBPlus to do this task. There's no way it can outperform IBO in this
> because the TIB_DataPump distills everything down to virtually raw API
> calls
> with minimal overhead and it even uses the same buffer space. Your pumping
> of data boils down to this:
>
> Prepare all necessary cursor/dsql statements.
> Organize all of the column mappings.
> Look for column assignments that are compatible for sharing buffer space.
> (DIRECT)
> Open the source cursor.
>
> Begin loop:
> CALL API TO FETCH SOURCE
> If non DIRECT buffering then
> Assign values between those columns.
> CALL API TO EXECUTE DEST
> End loop:
>
> So, if all of your columns are directly buffer compatible you have a loop
> of
> two API calls going on. You cannot TOP that!
>
> IBO is not for people who want to just slap together basic routines and
> expect top notch performance. IBO is for those who are willing to come to
> know it as if their livlihood depended on it and to always be willing to
> ask: Am I making the most of this toolset?
>
> If I was just doing some quick and dirty things that required no long-term
> maintenance and were just one-off tasks then a cheap tool like FIB+ is
> likely the way to do. But, if you have a serious project and you are in a
> committed relationship to it where all performance you can get with the
> least amount of effort (aside from some learning curve) is what you want,
> then you are definitely the right customer for IBO. It is written with
> that
> kind of development environment in mind.
>
> Regards,
> Jason Wharton
>
>
>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>