DirectSpaceState3D::intersect_ray/shape being slower that the equivalent node #12444
Jeghams
started this conversation in
Engine Core
Replies: 1 comment 2 replies
-
I wonder if having it take a callback would be better. Anyway, as far as I know that API is on hold until GDScript get "struct"s (which are not structs). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It is a known issue that the physics api for ray casting and shape casting is slower (up to 5x) than the equivalent RayCast3D, ShapeCast3D nodes. Currently, when performance is critical, the most efficient way to ray/shape cast is to have node (often as an autoload) that we reuse to get the results, it doesnt really make sense that a node is faster than the lower level api, the whole point of the api is to skip the overhead of nodes and have as thin of a layer as possible, i'm not entirely sure what is the cause of this , it is most likely because these methods return a Dictionary which's creation is more expensive than the physics query itself, there must be an overlook somewhere but we should have a a way to efficiently query the physics server.
I made a discussion instead of an Issue because i don't know what need to change or where really the bottleneck is, i suspect its the Dictionary.
Beta Was this translation helpful? Give feedback.
All reactions