chore: optimise creditsController #2359

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

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.

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.
Sainan added 1 commit 2025-06-30 01:34:35 -07:00
chore: optimise creditsController
All checks were successful
Build / build (pull_request) Successful in 59s
8683d4e85d
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.
Sainan merged commit 0c9b27a29b into main 2025-06-30 11:05:51 -07:00
Sainan deleted branch faster-credits 2025-06-30 11:05:54 -07:00
Sign in to join this conversation.
No description provided.