[core] Call loop() directly in main loop, bypass call() indirection

In the main loop, components in looping_components_ active section are
guaranteed to be in LOOP state. The call() method's state machine
dispatch (checking CONSTRUCTION, SETUP, FAILED, LOOP_DONE) is only
needed during Application::setup(). In the main loop it adds two
unnecessary function call frames per component per iteration
(call() -> call_loop_() -> loop()).

This became dead weight when looping_components_ partitioning was
introduced in June 2025 (8a06c4380d). Before that, Application::loop()
iterated components_[] which contained all states, so the state check
was necessary.
This commit is contained in:
J. Nick Koston
2026-03-03 22:22:51 -10:00
parent 9371159a7e
commit 36a598fa40
+1 -1
View File
@@ -173,7 +173,7 @@ void Application::loop() {
{
this->set_current_component(component);
WarnIfComponentBlockingGuard guard{component, last_op_end_time};
component->call();
component->loop();
// Use the finish method to get the current time as the end time
last_op_end_time = guard.finish();
}