Optimize hot path performance: cache config lookups and streamline list operations #347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several performance bottlenecks exist in request handling hot paths, particularly repeated
application:get_env/3calls and inefficient list operations.Changes
Cache configuration lookups in
nova_router.erldispatch_backendin function scope forexecute/2,lookup_url/3,add_routes/2,render_status_page/*, andadd_plugin/1global_pluginslookup fromcompile_paths/3loop tocompile/3, passing via Options maplookup_url/4helperCache session manager in
nova_session.erlpersistent_termduring supervisor initapplication:get_env/3withpersistent_term:get/2inget_session_module/0Optimize list operations in
nova_router.erlRouterRoutes ++ lists:append(ControllerRoutes)with singlelists:append([RouterRoutes | ControllerRoutes])inget_routes/2Simplify module loading in
nova_basic_handler.erlcode:is_loaded/1+code:load_file/1pattern with direct try/catchImpact
Reduces overhead in:
execute/2)get/set)render_dtl/3)compile_paths/3loop)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.