mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
f250898a3b
fix https://linear.app/tryghost/issue/SLO-168/rangeerror-maximum-call-stack-size-exceeded - this code takes the API output and reduces it down to collect together stats per date - the current code is recursive, and we've seen errors with the recursion hitting a `RangeError: Maximum call stack size exceeded` error - as well as that, we're doing a lot of array concat'ing and cloning, which burns memory and CPU time - instead, we can just use `.reduce` - the new implementation is much faster than the existing one (1ms vs 85ms) and uses no recursion, so those errors should go away - I've also verified that the output is the same between the two functions |
||
---|---|---|
.. | ||
analytics.js | ||
bound-one-way.js | ||
caja-sanitizers.js | ||
copy-text-to-clipboard.js | ||
ctrl-or-cmd.js | ||
currency.js | ||
fetch-koenig-lexical.js | ||
flatten-grouped-options.js | ||
get-scroll-parent.js | ||
ghost-paths.js | ||
isNumber.js | ||
link-component.js | ||
merge-stats-by-date.js | ||
password-generator.js | ||
publish-options.js | ||
route.js | ||
selection-list.js | ||
sentry.js | ||
shortcuts.js | ||
slug-url.js | ||
window-proxy.js |