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

Fix unnecesary data copy during the curl calls. #71

Open
wants to merge 1 commit into
base: 1.0.0
Choose a base branch
from

Conversation

Dwordcito
Copy link
Member

Description

This PR aims to remove unnecesary copies during the some methods calls(when we have a data as parameter)

Copy link
Member

@pereyra-m pereyra-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Dwordcito

I've made a local test and I'm not sure about the result I have.

I've run the Post100Mbs test with both the dev branch and 1.0.0, adding an extra message:

    std::cout << "RSS usage: " << postPost - prePost << std::endl;

These are the results

dev

root@042fbd6253cf:/workspaces/wazuh-http-request/build/test/component# ./urlrequest_component_test --gtest_filter="*Post100Mbs*"
Note: Google Test filter = *Post100Mbs*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ComponentTestInterface
[ RUN      ] ComponentTestInterface.Post100Mbs
RSS usage: 237320
[       OK ] ComponentTestInterface.Post100Mbs (514 ms)
[----------] 1 test from ComponentTestInterface (514 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (521 ms total)
[  PASSED  ] 1 test.

1.0.0


root@042fbd6253cf:/workspaces/wazuh-http-request/build/test/component# ./urlrequest_component_test --gtest_filter="*Post100Mbs*"
Note: Google Test filter = *Post100Mbs*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ComponentTestInterface
[ RUN      ] ComponentTestInterface.Post100Mbs
RSS usage: 233072
[       OK ] ComponentTestInterface.Post100Mbs (694 ms)
[----------] 1 test from ComponentTestInterface (694 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (700 ms total)
[  PASSED  ] 1 test.

This comparison doesn't reflect the improvement in RSS (although it seems faster), what could be the problem?

@Dwordcito
Copy link
Member Author

add the log/call(to get the rss) inner the post method in httpRequest.cpp because the peak is removed from this section to check the enhancement.

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.

2 participants