mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
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:
parent
307ac81aec
commit
b39c01e5e9
14 changed files with 1674 additions and 461 deletions
|
|
@ -538,6 +538,32 @@ pub fn make_rbxl_from_chunks(chunks: &[librojo::web_api::ServiceChunk]) -> Vec<u
|
|||
}
|
||||
}
|
||||
|
||||
let visible_services = [
|
||||
"Lighting",
|
||||
"MaterialService",
|
||||
"ReplicatedFirst",
|
||||
"ReplicatedStorage",
|
||||
"ServerScriptService",
|
||||
"ServerStorage",
|
||||
"SoundService",
|
||||
"StarterGui",
|
||||
"StarterPack",
|
||||
"StarterPlayer",
|
||||
"Teams",
|
||||
"TextChatService",
|
||||
"VoiceChatService",
|
||||
"Workspace",
|
||||
];
|
||||
let existing: std::collections::HashSet<String> = chunks
|
||||
.iter()
|
||||
.map(|c| c.class_name.clone())
|
||||
.collect();
|
||||
for &svc in &visible_services {
|
||||
if !existing.contains(svc) {
|
||||
dom.insert(root_ref, rbx_dom_weak::InstanceBuilder::new(svc));
|
||||
}
|
||||
}
|
||||
|
||||
let service_refs: Vec<Ref> = dom.root().children().to_vec();
|
||||
let mut buf = Vec::new();
|
||||
rbx_binary::to_writer(&mut buf, &dom, &service_refs).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue