Optimising `assert_eq` & `assert_ne`
Rust Internals
Optimising `assert_eq` & `assert_ne`
For running BorrowSanitizer on an assert_eq heavy test in Stringlet, I had to optimise it a lot. (I joined several into a single call assert_eq!((a1, a2, …), (b1, b2, …))). While trying to figure this out, VS code RA expand macro showed a pretty horrible, aka stemming from a time long before let-chains, implementation. I suggest the following solution, which in casual benchmarking compiles a multitude of these noticeably faster. Not sure if short-circuiting idents (to be more general, I tried ...
0 comments
No comments yet.