Server/project
gasmo 8d911ccc19 Fix ballooning recursive function (!120)
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>
2023-08-18 14:17:54 +00:00
..
.vscode Add Repo 2023-03-03 15:23:46 +00:00
assets Revert "Update JSONs + add new params to interfaces" 2023-08-10 16:02:33 +01:00
src Fix ballooning recursive function (!120) 2023-08-18 14:17:54 +00:00
tests Lint: ts files (!82) 2023-03-22 14:31:05 +00:00
.dockerignore Add Repo 2023-03-03 15:23:46 +00:00
.eslintignore Add Repo 2023-03-03 15:23:46 +00:00
.eslintrc.json Add Repo 2023-03-03 15:23:46 +00:00
.nvmrc Add Repo 2023-03-03 15:23:46 +00:00
.parcelrc Add Repo 2023-03-03 15:23:46 +00:00
.swcrc Add Repo 2023-03-03 15:23:46 +00:00
babel.config.js Add Repo 2023-03-03 15:23:46 +00:00
base_tsconfig.json Build server against es2021, instead of es2020 2023-07-29 14:26:42 +01:00
docker-compose.yml Add Repo 2023-03-03 15:23:46 +00:00
Dockerfile Add Repo 2023-03-03 15:23:46 +00:00
docs.Dockerfile Add Repo 2023-03-03 15:23:46 +00:00
gulpfile.mjs Add JSONC support to server configs + use by modders (!112) 2023-08-09 10:49:45 +00:00
jest.config.ts Add Repo 2023-03-03 15:23:46 +00:00
package.json Add JSONC support to server configs + use by modders (!112) 2023-08-09 10:49:45 +00:00
pkgconfig.json Add Repo 2023-03-03 15:23:46 +00:00
pnpm.Dockerfile Add Repo 2023-03-03 15:23:46 +00:00
rome.json Disable empty interface errors 2023-07-15 10:43:09 +01:00
Server.code-workspace Add Repo 2023-03-03 15:23:46 +00:00
test_tsconfig.json Add Repo 2023-03-03 15:23:46 +00:00
tsconfig.json Add Repo 2023-03-03 15:23:46 +00:00
typedef_tsconfig.json Add Repo 2023-03-03 15:23:46 +00:00
typedoc.json Add Repo 2023-03-03 15:23:46 +00:00