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
at high throughputs, PSL lookups can be quite intensive. for example, with 1000 calls to psl.get, this can take 400 milliseconds, and completely blocks the event loop. this seems to relatively linearly scale with more calls.
a recommendation is to use a simple Map cache; for example,
return psl.get(domain);
would be transformed to
if (!cache.has(domain)) {
cache.set(domain, psl.get(domain));
}
return cache.get(domain);
(with cache initialized at the top as a new Map).
As the psl.get results are static, this would only benefit the performance, with no drawbacks.
The text was updated successfully, but these errors were encountered:
One of the topics that came up in discussions for v5 was considering replacements for `psl` (see #255). This PR replaces that library with `tldts` which is more performant.
Fixes#239Fixes#338
tough-cookie/lib/pubsuffix-psl.js
Line 67 in 9b10131
at high throughputs, PSL lookups can be quite intensive. for example, with 1000 calls to psl.get, this can take 400 milliseconds, and completely blocks the event loop. this seems to relatively linearly scale with more calls.
a recommendation is to use a simple Map cache; for example,
return psl.get(domain);
would be transformed to
(with cache initialized at the top as a new Map).
As the psl.get results are static, this would only benefit the performance, with no drawbacks.
The text was updated successfully, but these errors were encountered: