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(plugins-iterator): remove unneeded tail-calls and optimize lookup_cfg #13511

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bungle
Copy link
Member

@bungle bungle commented Aug 16, 2024

Summary

This might create less garbage and generate better JIT code.

It would be nice to test if this has any difference in Kong benchmarks.

@github-actions github-actions bot added core/proxy cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Aug 16, 2024
@bungle bungle force-pushed the perf/plugin-iterator-lookup-cfg branch from d8fb9dc to 7c0e293 Compare August 16, 2024 16:35
@@ -82,7 +81,7 @@ local PluginsIterator = {}
-- @tparam string|nil consumer_id The consumer identifier. If `nil`, an empty string is used.
-- @treturn string The compound key, in the format `route_id:service_id:consumer_id`.
local function build_compound_key(route_id, service_id, consumer_id)

Choose a reason for hiding this comment

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

Just trying to understand the code and new to Lua.
Is there any reason to keep this function if we are not using it and the scope is local as well ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@SauravPrakash98 it is used during building new plugin iterator, just not used on request time.

@bungle bungle force-pushed the perf/plugin-iterator-lookup-cfg branch from 7c0e293 to 6dee3bb Compare September 2, 2024 18:27
…p_cfg

### Summary

This might create less garbage and generate better JIT code.

It would be nice to test if this has any difference in Kong benchmarks.

Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
@bungle bungle force-pushed the perf/plugin-iterator-lookup-cfg branch from 6dee3bb to dd56daf Compare September 9, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/proxy size/M skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants