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
⚡️ Speed up function process_result by 100% in PR #3819 (feature/defer)
To optimize the provided code, we can reduce the number of checks by combining related conditionals and accessing properties once instead of multiple times. Furthermore, we can streamline the creation of the `data` dictionary. Here is an optimized version of the code.
In this optimized version.
- We access `result.errors` and `result.extensions` once and store their values in the `errors` and `extensions` variables, respectively.
- We use dictionary unpacking with conditionals to add the "errors" and "extensions" keys to `data` only when they are present.
This should provide a minor performance improvement while maintaining the same functionality.
0 commit comments