graasp / graasp/graasp-api

Optimize and improve consistency of `mapById`

Open
#585 1 comment 0 reactions 0 assignees View on GitHub
bug :beetle: feature
Dominant language
TypeScript
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Many operations retrieve multiple rows from database given multiple ids passed as input arguments. The result is then grouped by input id, using the `mapById` function. However, this function runs in `O(|results|*|inputs|)` because we iterate over the results and for each we re-iterate over the ids. A group-by operation can however be performed in `O(|results|)` only by storing into bins at each iteration of the results only.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.