Lazily evaluate CallContext#1328
Conversation
|
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1328 |
|
Thanks for your contribution. You started originally with "the What is the end goal -- performance? If yes, could we maybe consider on having a cheap Like I wrote on Discord:
TLDR: I think it's good to cut down on useless string conversions, but we need to approach it with a clear scope 🙂 |
|
Yeahhh hahah this got way out of hand. The irony is that my original take on this was to just wrap the name in a Long story short, I wound up right back at the debug_assertions limitation in a seemingly futile attempt to make it safe, but much more circuitously. I'm just going to close this and put up a PR that's like... Maybe 6 lines of code not counting a benchmark 😅 |
Was seeing some noticeable allocation time spent in
rust_callable_call_fnin a project where I am pretty dependent on it. Turns out it was from convertingGStringtoStringon every invocation, which is mostly just for debugging anyway.Saw the TODO to make call_ctx lazy evaluated and decided to take a swing at it since it gets at the root of the problem.
I think something a little more sophisticated than a closure could be used for the derive macro, since it expands to some repeated code, but I think this works as a drop-in replacement.