-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance difference between Poco::FileStream and low level windows functions #2475
Comments
I think I found the problem could be here
BUFFER_SIZE is 4096 so the WriteFile windows function for 2MB data is called several time not in one time only. I check if I can change it deal with it, any suggestions? @obiltschnig @aleks-f |
Try to increase it and see if you find a sweet spot between buffer size and performance (e.g., 64 K). Windows machines have plenty of RAM these days. Alternatively, we could make BUFFER_SIZE configurable also. |
I do not understand one thing: why we use here a BasicBufferedBidirectionalStreamBuf? I don't think we made some internal buffer copy of the data to be written, isn't it? Probably we should manage code to make it call directly the WriteToDevice function with buffer from application |
using BUFFER_SIZE of 64*1024 I reach the performance of low level functions |
With iostreams you cannot pass the client buffer directly to WriteToDevice, unfortunately. |
This issue is stale because it has been open for 365 days with no activity. |
Expected behavior
Poco::FileStream under windows internally use low level CreateFile WriteFile functions. I think should have almost the same performance in writing files
Actual behavior
What I found is that (with an test USB memory) using Poco::FileStream for writing files of 2MB each I can write about 1 file/sec. Using directly the WriteFile winfows functions I can write about 5 files/sec
Steps to reproduce the problem
code to test
POCO version
1.9.1
Compiler and version
visual studio 2015
Operating system and version
windows 10
Other relevant information
The text was updated successfully, but these errors were encountered: