atc-router
atc-router copied to clipboard
perf(interpreter): improve ATC interprater's cache efficiency
Convert to draft and need more testing and re-work. thanks.
There is a way to eliminate the clone() of Predicate inside Lir when converting from Expression. Perhaps we can get rid of it too on Cir? Predicate is relatively large, not cloning it may result in better performance.
Update:
Not using clone() on Cir is likely not do-able. Expression will drop after the matcher is built. But it's still good to remove twice clone() between Translation of Expression to Lir and Lir to Cir.
Could we use something like std::mem::take to do a "partially move out" (and fill a default empty value into original place)? I think the risks may outweigh the benefits.
Hey! @xianghai2 - could you attach some benchmarking reports to this PR? I guess just run the benches on main branch and this branch to see the impact of this optimization.
@nowNick you may refer to https://konghq.atlassian.net/browse/KAG-5334 for benchmark details. thanks.