trichview.com

trichview.support




Re: SaveRVFToStream slow?


Return to index


Author

Message

Holger Warzelhan

Posted: 08/17/2004 21:32:36


Hello Sergey,


I made some more tests, to find out where my problem is that saving to a

stream takes so long. Maybe you have an idea to help?


I took the demo project in Demos\Delphi\Editors\Editor 2\REditor, and added

2 buttons.

One is saving the currently loaded document using rve.SaveRVFToStream() to

a TMemoryStream and also direclty to a file using rve.SaveRVF().

The other one loads the document back from stream and file into the rve.


I have a few .rvf files that I use to test the time the program needs to

do the action. These documents consist of a table with 2 columns and several

rows, where always the left column contains a picture and the right column

contains some text.

Here are the results:


1) RVF-File  3.6MB: SaveRVF= 90ms, LoadRVF=0.3s , SaveRVFToStream=4.51s ,

LoadRVFToStream=0.25s

   SaveRVFToStream takes 50 times as long as SaveRVF

2) RVF-File  9.5MB: SaveRVF=0.24s, LoadRVF=0.72s, SaveRVFToStream=30.1s ,

LoadRVFToStream=0.69s

   SaveRVFToStream takes 125 times as long as SaveRVF

3) RVF-File 20.2MB: SaveRVF=1.37s, LoadRVF=1.55s, SaveRVFToStream=143.6s,

LoadRVFToStream=1.56s

   SaveRVFToStream takes 105 times as long as SaveRVF


I have tested this on 2 different computers, they all have enough memory

(Windows XP, 512MB RAM), and depending on the speed of the machines, the

results are the same.


Why do I care about it, you might ask. I want to make some kind of an auto

save function that saves the current document every so often to a stream,

and at the moment it would mean that the program gets stuck for more than

2 minutes at a time just to save the document.


I am sure there is a solution to this, because it doesn't make sense. Saving

to a file should be definitely slower than saving to memory using a stream.

Looking at the loading times, you can see it happens with about the same

speed.


Any idea would be appreciated.


Holger


"Sergey Tkachenko" <svt@trichview.com> wrote:

>I did not make any comparition on this subject.

>May be your computer was low on memory?

>





Powered by ABC Amber Outlook Express Converter