poco
poco copied to clipboard
Using native sendfile from OS for HttpServer
This PR is motivated by https://github.com/pocoproject/poco/pull/3368 and continuation of https://github.com/pocoproject/poco/pull/4007
If OS has native implementation of sendfile function then it will be used (only for cmake projects).
Other projects (make and vcxporj) you can uncomment define POCO_HAVE_SENDFILE
in Poco/Config.h
Note for emscripten sendfile will throw NotImplemented exception, because https://github.com/emscripten-core/emscripten/pull/16234
Simple proof that this optimization is useful
Test without optimization
testFile:
OK (1 tests)
./Net-testrunner testFile 0.04s user 0.01s system 15% cpu 0.297 total
Test with optimization
testFile:
OK (1 tests)
./Net-testrunner testFile 0.03s user 0.01s system 5% cpu 0.842 total
15% vs 5%
Hi, @obiltschnig ! May be You have any remarks?
@bas524 , can you rebase on latest code on main branch, please?
@bas524 , can you rebase on latest code on main branch, please?
Hi, ok. I'll do it this week