chore: optimise creditsController #2359

Merged
Sainan merged 1 commits from faster-credits into main 2025-06-30 11:05:51 -07:00

1 Commits

Author SHA1 Message Date
8683d4e85d chore: optimise creditsController
All checks were successful
Build / build (pull_request) Successful in 59s
Doing both lookups in parallel saves around 1 ms in the happy case (20% of baseline time), and in case nonce does not match, the error is simply raised as per usual with the inventory request being lightweight enough to be negligible.

Noteworthy that this reasoning doesn't really work for other controllers because in the error case, the inventory request would still be quite significant, even if the HTTP request itself would still finish quickly.
2025-06-30 10:34:34 +02:00