Skip to content

This is not as fast as C#, and I stronly suspect it's because of the C# String to Rust FFI passing #1

@jrouaix

Description

@jrouaix

To sum up what is done when an already parsed expression is call from C# :

  • only if the identifier exists in the expression, the identifier / value pair is send through FFI
  • dotnet converts string to CStr when calling the native method
    public static extern FFIStringHandle ffi_exec_expr(FFIExpressionHandle ptr, FFIIdentifierKeyValue[] identifier_values, UIntPtr identifier_values_len);
  • then when the Rust side wants to use the string it's converting back the CStr to Rust String
    CStr::from_ptr(s)

It's really a pitty !

Is there a way to send a string usable directly from Rust, or to send a raw dotnet pointer to the String an allow Rust to go digging the value right into C# managed memory ... I need help here ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions