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
The current scoring and reporting logic is not written in a performance way.
The logic for groups and plugins is different from groups and audits. If we unify the data structures it would simplify the code
We can score groups at the beginning
We can add the plugin to slug to audits and groups to avoid a nested loop
For scoring the categories could introduce a dict with keys like ${plugin}${type}${slug} to reduce the iterations
In categoryRefToScore and groupRefToScore we use find to get the score or a specific audit or group. This is done for each ref in a category. If we intro a dictionaries for plugins we can avoid it.
To improve the performance I suggest to do the following things:
We should introduce a function that scores a report one time so ti can be reused for the different report formats
Update:
After the recent changes we decided to remove the plugin in audits in ScoredReport and go with a dic of audits under plugins where key a combination of type, plugin, audit/group.
Improved the performance of scoring and reporting.
Removed nested loops where possible, added dictionaries to go constant
time O(1) instead of linear O(n).
Made minor refactoring, added some checks.
@BioPhoton As task owner, let me know if I understood the task correctly
and implemented everything properly. Also, maybe you could propose
additional changes for further performance improvements.
Closes#132
The current scoring and reporting logic is not written in a performance way.
slug
to audits and groups to avoid a nested loop${plugin}${type}${slug}
to reduce the iterationscategoryRefToScore
andgroupRefToScore
we usefind
to get thescore
or a specificaudit
orgroup
. This is done for each ref in a category. If we intro a dictionaries for plugins we can avoid it.To improve the performance I suggest to do the following things:
Update:
After the recent changes we decided to remove the plugin in audits in
ScoredReport
and go with a dic of audits under plugins where key a combination of type, plugin, audit/group.related to #137 and #133
The text was updated successfully, but these errors were encountered: