8d911ccc19
The `BotEquipmentModPoolService.generatePool()` method is recursive, but it does not check if the pool it creates already contains data for sub items when it finds them and calls itself on them. This creates substantial bloat in the function that is undetectable to end users, but causes some additional delay when it is called. I noticed this when using a server mod that allows for less restrictions on mod combinations (as it would hit the system recursion limit and error out) but the bloat still affects vanilla - it takes ~1 minute for all the recursive calls to end, whereas this fix reduces that to <10 seconds. To fix this, I've moved a block of code into the conditional block that checks if the item we're adding (and its' sub items) are already in the pool before it calls itself. This is my first pull request, so let me know if I've fudged up somewhere and I'll do my best to fix it. I submitted a previous request about this, but I removed my name from the commits so I had to delete the branch. Co-authored-by: gasmo <burr.cameron@gmail.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/120 Co-authored-by: gasmo <gasmo@noreply.dev.sp-tarkov.com> Co-committed-by: gasmo <gasmo@noreply.dev.sp-tarkov.com> |
||
---|---|---|
.. | ||
.vscode | ||
assets | ||
src | ||
tests | ||
.dockerignore | ||
.eslintignore | ||
.eslintrc.json | ||
.nvmrc | ||
.parcelrc | ||
.swcrc | ||
babel.config.js | ||
base_tsconfig.json | ||
docker-compose.yml | ||
Dockerfile | ||
docs.Dockerfile | ||
gulpfile.mjs | ||
jest.config.ts | ||
package.json | ||
pkgconfig.json | ||
pnpm.Dockerfile | ||
rome.json | ||
Server.code-workspace | ||
test_tsconfig.json | ||
tsconfig.json | ||
typedef_tsconfig.json | ||
typedoc.json |