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
@wenym1 found that anyhow!(...) can take several hundred ms to construct (#6131) and there are several places in our codebase using ok_or(anyhow!(...)), which eagerly constructs the anyhow error and can significantly increase call latency even if there is no error happening.
We should switch to ok_or_else, which perform lazy evaluation, and avoid this usage in the future.
Describe the bug
@wenym1 found that anyhow!(...) can take several hundred ms to construct (#6131) and there are several places in our codebase using
ok_or(anyhow!(...))
, which eagerly constructs the anyhow error and can significantly increase call latency even if there is no error happening.We should switch to
ok_or_else
, which perform lazy evaluation, and avoid this usage in the future.Places to fix:
https://rust-lang.github.io/rust-clippy/master/#/or_fun_call
cargo clippy -- -W clippy::or_fun_call
risingwave/src/rpc_client/src/lib.rs
Line 246 in a1668f2
risingwave/src/rpc_client/src/lib.rs
Line 264 in a1668f2
risingwave/src/connector/src/parser/unified/avro.rs
Line 130 in a1668f2
risingwave/src/connector/src/parser/unified/avro.rs
Line 140 in a1668f2
risingwave/src/connector/src/sink/coordinate.rs
Line 64 in a1668f2
risingwave/src/stream/src/common/log_store/in_mem.rs
Line 244 in a1668f2
risingwave/src/connector/src/source/kafka/private_link.rs
Line 150 in a1668f2
Error message/log
No response
To Reproduce
No response
Expected behavior
No response
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: