ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 File read performance
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Ronald

Netherlands
17 Posts

Posted - Dec 15 2011 :  13:29:12  Show Profile  Reply
Hello,

We have customer that complains about performance of displaying image files (15 Mb) that are read via their network. Copying via Explorer was about 2 times faster than ImageEn.

Customer is large organization with busy network (performance in our small business network was OK).

It turned out that files we tested (15Mb Dicom) was read in blocks of 4-8 Kb, while Explorer reads 64Kb blocks. My question is: how can we make ImageEn read files in larger chunks? Is this a setting somewhere?

Any suggestions are welcome.

Regards, Ronald

Ronald

Netherlands
17 Posts

Posted - Dec 15 2011 :  14:32:48  Show Profile  Reply
After digging in the source code a bit, it seems that alle read operations use TIEBufferedReadStream with size of 8192.

I wonder if it would it be a good idea to make this size a constant, and increase to 64k , or even 1 Mb. Does this have side effects?

Anyone have experience increasing file read buffer size?

Regards, Ronald
Go to Top of Page

fab

1310 Posts

Posted - Dec 16 2011 :  00:38:11  Show Profile  Reply
No, it hasn't side effects. If you find that increasing the reading buffer size does enhance performance we will set a global variable for it. Please let me know.
Go to Top of Page

Ronald

Netherlands
17 Posts

Posted - Dec 20 2011 :  08:40:15  Show Profile  Reply
Hi Fabrizio,

We did some testing and noticed:

XP client, 15 Mb Dicom file:
- Reading from fileshare with ImageEn is much slower than copying with Explorer
- Reading from fileshare goes much faster in 64Kb blocks. (3,4s -> 2,0s)
- Bigger blocksize than 64 Kb did not result in better performance
- For reading from local harddisk blocksize did not matter much

Windows 7 client, same file:
- blocksize did not matter much
- Some cachin is done, 2nd read is much faster

For the tests, we modified ideicom.pas, line 3788:
ctx.Stream := TIEBufferedReadStream.Create(Stream, 8192, iegUseRelativeStreams);
We modified 2nd parameter (8192)

so we think reading in 64Kb blocks improves reading speed dconsiderably under XP. We did not notice any side effects (yet:-)

refer to http://support.microsoft.com/kb/q223140 for more info. From this link, I conclude that hardcoding 64Kb is OK, instead of adding global Const...

Regards, Ronald
Go to Top of Page

fab

1310 Posts

Posted - Dec 21 2011 :  02:17:46  Show Profile  Reply
Hi Ronald,
many thanks for your tests. I will update Dicom reading buffer size to 64K.
Go to Top of Page

Ronald

Netherlands
17 Posts

Posted - Dec 21 2011 :  14:43:29  Show Profile  Reply
Hi Fabrizio,

May I suggest increasing read buffer for other file formats, too?

Regards, Ronald
Go to Top of Page

Murat

Russia
48 Posts

Posted - Dec 21 2011 :  23:20:39  Show Profile  Reply
Hi Fabrizio,

Will you increase the read buffer size for other formats (photo, camera raw)?
Go to Top of Page

fab

1310 Posts

Posted - Dec 22 2011 :  01:06:19  Show Profile  Reply
It will be increased also for jpeg (other formats doesn't use this buffer or values are already optimized).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: