iann0036 / aws.permissions.cloud

A crowdsourced AWS IAM permissions reference.
https://aws.permissions.cloud
MIT License
84 stars 9 forks source link

optimize: Speed up /tag/ and /iam/ pages #15

Closed exoego closed 9 months ago

exoego commented 9 months ago

I found the getUsedBy function is compute-heavy since it iterates sdk_map['sdk_method_iam_mappings'] many times. By caching the action-to-iam_mapping_name mapping, /tag/* and /iam/* pages are now very fast.

Page Before After
https://aws.permissions.cloud/tag/aws:RequestTag/$%7BTagKey%7D 10,768 ms 11 ms
https://aws.permissions.cloud/iam/dynamodb 487 ms 10 ms
https://aws.permissions.cloud/iam/s3 860 ms 10 ms