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
After profiling a Fresh application in production, we found out that the current URL/route matching through URLPattern is expensive both in consumed CPU time and memory usage:
At the time of this writing our app has ~800 static-files routes, and a total of ~900 routes overall. Each one of those translates to a dedicated URLPattern instance.
On each request, URLPattern.exec(url) is called in a loop until a matching route is found (if any).
Unfortunately at the moment the URLPattern implementation in Deno is known to have some performance issues: denoland/deno#19861.
Under sustained organic traffic, it looks like this quickly becomes an hot tight-loop, consuming most of the CPU active time.
From the same profile, it looks like this is also causing a lot of pressure on V8 memory handler.
The text was updated successfully, but these errors were encountered:
After profiling a Fresh application in production, we found out that the current URL/route matching through
URLPattern
is expensive both in consumed CPU time and memory usage:fresh/src/server/router.ts
Lines 146 to 152 in d391924
At the time of this writing our app has ~800 static-files routes, and a total of ~900 routes overall. Each one of those translates to a dedicated
URLPattern
instance.On each request,
URLPattern.exec(url)
is called in a loop until a matching route is found (if any).Unfortunately at the moment the
URLPattern
implementation in Deno is known to have some performance issues: denoland/deno#19861.Under sustained organic traffic, it looks like this quickly becomes an hot tight-loop, consuming most of the CPU active time.
From the same profile, it looks like this is also causing a lot of pressure on V8 memory handler.
The text was updated successfully, but these errors were encountered: