tlopex commented on code in PR #685:
URL: https://github.com/apache/tvm-ffi/pull/685#discussion_r3653343569
##########
rust/tvm-ffi-macros/src/match_any.rs:
##########
@@ -24,6 +24,11 @@ use syn::{braced, parenthesized, Expr, Pat, Path, Result,
Token};
use crate::utils::get_tvm_ffi_crate;
+// Keep single-arm matches ordered. Release benchmarks of the standard
ObjectRef
+// conversion path show that lookup pays off from two arms when a later arm or
+// the fallback is reached.
+const MIN_LOOKUP_TABLE_ARMS: usize = 2;
Review Comment:
I have a test that shows 2 is best.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]