poco icon indicating copy to clipboard operation
poco copied to clipboard

Using native sendfile from OS for HttpServer

Open bas524 opened this issue 1 year ago • 3 comments

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%

bas524 avatar Dec 16 '23 14:12 bas524

Hi, @obiltschnig ! May be You have any remarks?

bas524 avatar Jan 16 '24 08:01 bas524

@bas524 , can you rebase on latest code on main branch, please?

matejk avatar Jul 29 '24 06:07 matejk

@bas524 , can you rebase on latest code on main branch, please?

Hi, ok. I'll do it this week

bas524 avatar Jul 31 '24 14:07 bas524