Add matching session caching and native codegen improvements

- Introduced a new matching session caching mechanism in the Lua matching module to enhance performance with native code generation.
- Rewrote the Lua matching algorithm to utilize session-based caching, reducing redundant computations and improving efficiency.
- Updated Rust implementations to include session caching, ensuring consistency across both Lua and Rust.
- Enhanced the `hydrate` function to support session management during instance hydration.
- Added comprehensive tests to validate the new caching mechanism and its integration with existing functionality.

These changes significantly improve the performance and maintainability of the matching process in the application.
This commit is contained in:
Joe 2026-02-18 04:55:31 -06:00
parent 307ac81aec
commit b39c01e5e9
14 changed files with 1674 additions and 461 deletions

View file

@ -208,6 +208,7 @@ pub fn syncback_dir_no_meta<'sync>(
.collect();
// Run the 3-pass matching algorithm to pair new ↔ old children.
let matching_session = crate::syncback::matching::MatchingSession::new();
let match_result = match_children(
&eligible_new,
&eligible_old,
@ -215,6 +216,7 @@ pub fn syncback_dir_no_meta<'sync>(
snapshot.old_tree(),
None, // TODO: pass precomputed hashes for better similarity
None,
&matching_session,
);
// Pre-seed taken_names from ALL matched old children's filesystem