Skip to content

Rust::com FFI Type Lookup Optimization on Fast Path#541

Open
bharatGoswami8 wants to merge 10 commits into
eclipse-score:mainfrom
bharatGoswami8:FFI_HashMap_Lookup_Optimization
Open

Rust::com FFI Type Lookup Optimization on Fast Path#541
bharatGoswami8 wants to merge 10 commits into
eclipse-score:mainfrom
bharatGoswami8:FFI_HashMap_Lookup_Optimization

Conversation

@bharatGoswami8

@bharatGoswami8 bharatGoswami8 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
  • Replaces string-based event/type identifiers across C++ and Rust FFI with an opaqueTypeOperationshandle propagated as a Rust TypeOperationsManager.

  • Adds mw_com_get_type_ops_instance and get_type_ops_instance , updates all sample/allocatee/event FFI paths to accept/forward TypeOperations and removes event-type params from proxy receive-handler APIs.

Approach:
Store the TypeOperations instance pointer within MemberOperation and pass it to the Rust side using a getter. On the Rust side, we define an opaque struct that holds this pointer during subscription and publisher creation. Instead of passing T::ID, we now pass the type_operation pointer as a parameter to C++. This removes the need for repeated lookups on the C++ side, allowing us to directly invoke the underlying TypeOperations functions and APIs.

* TypeOperation is part of MemberOperation
* Added typeOperation related method in cpp and rust
* Producer side updated with TypeOperation
* Update SamplePtr related method to use TypeOperation
* Updated consumer method to take typeOperation as parameter
* Removed the registry related types and function
* Removed registry creation from macro
* Added Option return for FFI method
* Added error handing for consumer and producer type_ops
* Added const in GetType
* Updated type_ops in producer
* Update test cases and mock FFI
* Updated Receive poll method
* General Optimization
@bharatGoswami8 bharatGoswami8 force-pushed the FFI_HashMap_Lookup_Optimization branch from effec41 to f93a190 Compare June 15, 2026 04:02
@bharatGoswami8 bharatGoswami8 self-assigned this Jun 15, 2026
@bharatGoswami8 bharatGoswami8 marked this pull request as ready for review June 15, 2026 04:05
* Fix the clippy warning error
@bharatGoswami8 bharatGoswami8 force-pushed the FFI_HashMap_Lookup_Optimization branch from bd846a9 to 77c9901 Compare June 15, 2026 04:49
Comment thread score/mw/com/impl/rust/com-api/com-api-runtime-lola/consumer.rs
Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/registry_bridge_macro.cpp Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/bridge_ffi.rs Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/registry_bridge_macro.h Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/registry_bridge_macro.h Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-runtime-lola/producer.rs Outdated
@bharatGoswami8 bharatGoswami8 force-pushed the FFI_HashMap_Lookup_Optimization branch from 81a0d45 to 2aedd32 Compare June 16, 2026 04:08
@bharatGoswami8 bharatGoswami8 force-pushed the FFI_HashMap_Lookup_Optimization branch from 2aedd32 to 73a84ca Compare June 16, 2026 04:59
Comment thread score/mw/com/impl/rust/com-api/com-api-ffi-lola/bridge_ffi.rs Outdated
* Added const on FFI methods
* Added Copy Marker trait
* Updated clone of type_ops
@bharatGoswami8 bharatGoswami8 force-pushed the FFI_HashMap_Lookup_Optimization branch from 73a84ca to b961ca4 Compare June 16, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants