atc-router icon indicating copy to clipboard operation
atc-router copied to clipboard

perf(interpreter): improve ATC interprater's cache efficiency

Open xianghai2 opened this issue 1 year ago • 3 comments

implementation for KAG-5152

xianghai2 avatar Sep 04 '24 03:09 xianghai2

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 04 '24 03:09 CLAassistant

Convert to draft and need more testing and re-work. thanks.

xianghai2 avatar Sep 10 '24 03:09 xianghai2

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.

00the 01-try-to-get-rid-of-clone-of-expr-to-lir.patch

Oyami-Srk avatar Sep 14 '24 07:09 Oyami-Srk

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.

xianghai2 avatar Oct 15 '24 09:10 xianghai2