Unnecessary system calls #3550
-
Hello! I have just recently taken an interest in Bevy and am trying to learn the basics and philosophy of Bevy and ECS. One thing that is bugging me is that there seems to be a lot of unnecessary system calls. A lot of times in development there are things that can only happen after certain other events. For example, in the events.rs file, the listener function gets called constantly, but it only really has an effect when the event trigger function triggers the event. Would it not be better to call this function directly from the trigger function? Or is the slowdown not perceptible enough that you should prefer the readability increase by generating events? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
So, this is a question of "push" vs "pull" styles for event management. Generally, the overhead of systems is very low, if they're not doing any work, they can be largely ignored. That said, we're at the brainstorming phase for other ways we can reduce these empty system calls: bevyengine/rfcs#32 is particularly relevant to your question :) |
Beta Was this translation helpful? Give feedback.
So, this is a question of "push" vs "pull" styles for event management. Generally, the overhead of systems is very low, if they're not doing any work, they can be largely ignored.
That said, we're at the brainstorming phase for other ways we can reduce these empty system calls: bevyengine/rfcs#32 is particularly relevant to your question :)