[FIXED] [Win] Speed of dB Creation
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu May 15 23:17:13 CDT 2003
on 5/15/03 10:15 PM, Brendan Murphy at bmurf at comcast.net wrote:
>> Hi Brendan,
>>
>>> Yes, that fixed the problem! I get the following numbers for adding
>>> 100,000
>>> records with my test
>>>
>>> Mac = 2.2 seconds
>>> PC = 1.1 seconds
>>
>> You mean adding 100,000 records without flush() ?
>
> Yes, no flushing. These results are as they should be (which is good).
>
>>> I have discovered a new related problem. In this new problem it is the
>>> Mac that is orders of magnitude slower than the PC. I modified my test
>>> application to do a flush after every record added to the database. I
>>> get the
>>> following results.
>>>
>>> Mac = 241 seconds
>>> PC = 8 seconds
>>>
>>> I have attached the modified test project to this email.
>>
>> Try to remove flush() and I think you will get comparable results.
>>
>> Look in latest beta I have simply comment out in FileWin::Flush()
>> The call to Windows FlushFileBuffers().
>>
>> It looks that FlushFileBuffers() is VERY SLOW function on Windows.
>> I don't know why, and will investigate later.
>>
>> So it looks like Windows version do not make TRUE system flush.
>> While MacOS still do. This is why you see adding of records 241
>> seconds I
>> think. Remove Flush() and speed should be comparable.
>>
>> Uoi should understand that if you do flush after EACH Add() you get
>> VERY
>> VERY big slowdown. If you add records in LOOP then better do flush
>> every 100
>> records for example.
>
> I know it is not very wise to do a flush after every record in a real
> application,
It cause no problems in e.g. GUI app, when user enter one record, and press
OK.
> but I added the flush as a regression test in the test
> application to see if anything was broken relative to Mac and PC
> performance concerning the flush call. I would expect the Mac to come
> in at 16 to 20 seconds when calling flush if there is a linear
> relationship between the Mac and PC.
1) once again. In b6 PC's flush() do not do system file flush.
Only logical.
2) Let's count. Apple say (and this show my tests) that we can do about 50
flushes per second on modern HDD. So 100,000 / 50 = 2000 seconds.
You get 241 second. Actually even 10 times faster ...Hmm.
> Your fix in version 1.9.8b6 covers 95% of what is needed in real world
> applications in terms of performance. I pointed it out so that you can
> put it on your todo list for things to investigate later on.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list