Copilot commented on code in PR #13345:
URL: https://github.com/apache/apisix/pull/13345#discussion_r3212599860


##########
apisix/init.lua:
##########
@@ -850,6 +853,7 @@ function _M.http_access_phase()
                 plugin.run_plugin(phase, api_ctx.plugins, api_ctx)
             end
         end
+        plugin.run_global_rules(api_ctx, global_rules, conf_version, "access")
         plugin.run_plugin("access", plugins, api_ctx)

Review Comment:
   Splitting global rules into separate rewrite/access calls means 
`plugin.run_global_rules()` now does the merge+`plugin.filter()` work twice per 
request (once per phase). Since the merged dummy global rule is already 
LRU-cached by `conf_version`, consider caching the filtered global-rule plugin 
list (or dummy_global_rule) on `api_ctx` after the rewrite call and reusing it 
for the access call to avoid extra allocations and filtering in the hot path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to