Skip to content
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

Using native sendfile from OS for HttpServer #4351

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

bas524
Copy link
Contributor

@bas524 bas524 commented Dec 16, 2023

This PR is motivated by #3368 and continuation of #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 emscripten-core/emscripten#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%

add option POCO_USE_SENDFILE_FOR_HTTPSERVER, default - OFF
add test for HttpServer - testFile
add define fro Config.h POCO_USE_SENDFILE_FOR_HTTPSERVER
CMakeLists.txt Outdated Show resolved Hide resolved
detected macro POCO_HAVE_SENDFILE
replace types for sendFile with platform depended
wrap possibility of using sendFile with macro, if sendFile doesn't exist
in OS, then all methods don't exist
@bas524
Copy link
Contributor Author

bas524 commented Jan 16, 2024

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

@matejk matejk deleted the branch pocoproject:main April 15, 2024 11:20
@matejk matejk closed this Apr 15, 2024
@matejk matejk reopened this Apr 22, 2024
@matejk matejk changed the base branch from devel to main April 22, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants