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

perf(*) make some heavily used code paths more cooperative by yielding #8888

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

bungle
Copy link
Member

@bungle bungle commented Jun 1, 2022

Summary

Adds yielding to some hot paths that otherwise may cause latency spikes with huge Kong configurations. The special focus was to make CP/DP config changes less blocking.

@bungle bungle requested a review from a team as a code owner June 1, 2022 17:00
@bungle bungle requested a review from dndx June 1, 2022 17:00
@bungle bungle changed the title perf(*) make some heavily used code paths more cooperative by yielding perf(*) make some heavily used code paths more cooperative by yielding (WIP) Jun 1, 2022
@bungle bungle force-pushed the perf/yielding-more branch 4 times, most recently from 0f4121b to cdc8e19 Compare June 1, 2022 20:53
@bungle bungle force-pushed the perf/yielding-more branch from 7139c75 to dfc639e Compare June 1, 2022 21:26
@bungle bungle changed the title perf(*) make some heavily used code paths more cooperative by yielding (WIP) perf(*) make some heavily used code paths more cooperative by yielding Jun 1, 2022
@bungle bungle added this to the 3.0 milestone Jun 1, 2022
@bungle bungle force-pushed the perf/yielding-more branch from dfc639e to 8dfe7f0 Compare June 1, 2022 21:58
### Summary

Adds yielding to some hot paths that otherwise may cause latency spikes
with huge Kong configurations. The special focus was to make CP/DP config
changes less blocking.
@bungle bungle force-pushed the perf/yielding-more branch from 8dfe7f0 to 1d7454d Compare June 2, 2022 08:22
@bungle
Copy link
Member Author

bungle commented Jun 2, 2022

Some initial tests show that this has a quite big improvement over max latency (the tests were ran in 2.8.1, where these were backported):
Screenshot from 2022-06-02 13-30-24

We do some further testing, but it looks promising.

Copy link
Member

@kikito kikito left a comment

Choose a reason for hiding this comment

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

Such a small and unobtrusive change for the benefit, totally worth it!

@bungle bungle merged commit 95d704e into master Jun 2, 2022
@bungle bungle deleted the perf/yielding-more branch June 2, 2022 15:28
chronolaw added a commit that referenced this pull request Jun 3, 2022
fffonion pushed a commit that referenced this pull request Jun 6, 2022
### Summary
DP/CP's code is too complex and not human readable, it is hard to understand the callback workflows.

This PR separates the logic of update_config, moves the code into an isolated file,
and also de-coupled dp/cp modules.

This PR is same as #8880, but solved the merge conflict of #8888.

### Full changelog
* separates the logic of `update_config` into `config_helper.lua`
* do not use `self` to mimic oop
* remove duplicated functions `extract_major_minor `and `validate_shared_cert` in wrpc_cp
* add many functions in `utils.lua`
* remove `version_handshake`
* pick #8888's yield feature in `to_sorted_string`
* update config hash test case
locao pushed a commit that referenced this pull request Apr 24, 2024
…eshed (#8888)

(cherry picked from commit 0d81517)

Co-authored-by: Keery Nie <windmgc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants