You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: eliminate hot-path filesystem and regex costs in handler/routing layer
Four targeted optimizations on the per-request execution path:
1. HandlerService: cache ImplicitViews setting
`getSetting("ImplicitViews")` was called on every handler dispatch where
the requested action was missing. It is now cached to variables scope in
onConfigurationLoad() alongside every other already-cached setting.
2. HandlerService.isViewDispatch: drop redundant fileExists(expandPath())
locateView/locateModuleView already verify file existence and return the
path with a .cfm/.bxm extension only when the file is confirmed present.
The follow-up fileExists() call was re-doing answered work. Replaced with
a cheap string suffix check — zero filesystem I/O.
3. RoutingService.findRoute: use cached canDebug local variable consistently
canDebug was already stored in a local variable at the top of findRoute()
but three spots inside the same method re-called getLogger().canDebug()
instead of using it. All three now use the cached local variable.
4. Router/RoutingService: pre-parse response string placeholders at registration
renderResponse() was running reMatchNoCase + reReplaceNoCase on the route's
static response string on every request. Tokens are now parsed once in
addRoute() into a responsePlaceholders array; renderResponse() iterates the
pre-parsed list with no regex at runtime. Also fixes a latent bug where
multiple placeholders were not all applied (original always replaced into
the original string rather than the accumulated result).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUinjJLvJod1u9s2e9T6zc
0 commit comments